Package jasima.shopSim.core
Class Shop
- java.lang.Object
-
- jasima.core.simulation.SimComponentBase
-
- jasima.core.simulation.SimComponentContainerBase
-
- jasima.shopSim.core.Shop
-
- All Implemented Interfaces:
SimComponent,SimComponentContainer,SimLifecycleListener,SimOperations,Notifier<SimComponent,SimComponent.SimComponentEvent>,NotifierListener<Simulation,Simulation.SimLifecycleEvent>,ValueStore,Cloneable
public class Shop extends SimComponentContainerBase
Implements a shop simulation. The scenarios covered are usually job shops and flow shops.- Author:
- Torsten Hildebrandt
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShop.ShopMessage-
Nested classes/interfaces inherited from interface jasima.core.simulation.SimComponent
SimComponent.ProduceResultsEvent, SimComponent.SimComponentEvent, SimComponent.SimComponentLifeCycleMessage
-
Nested classes/interfaces inherited from interface jasima.core.simulation.SimLifecycleListener
SimLifecycleListener.DoneListener, SimLifecycleListener.OtherListener, SimLifecycleListener.ResetStatsListener, SimLifecycleListener.ResultsListener, SimLifecycleListener.SimEndListener, SimLifecycleListener.SimInitialized, SimLifecycleListener.SimStartListener
-
Nested classes/interfaces inherited from interface jasima.core.simulation.util.SimOperations
SimOperations.SimEventType
-
-
Field Summary
Fields Modifier and Type Field Description intjobsFinishedintjobsStartedJoblastJobFinishedJoblastJobReleasedRoute[]routes-
Fields inherited from class jasima.core.simulation.SimComponentBase
sim
-
Fields inherited from interface jasima.core.simulation.SimComponent
NAME_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description Shop()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddJobSource(JobSource js)voidaddMachine(WorkStation machine)Adds a single machine to this shop.voidaddRoute(Route r)Shopclone()Public clone method.WorkStation[]getMachines()Gets an array of the workstations contained in this shop.intgetMaxJobsInSystem()Returns the maximum number of jobs in the system, before the simulation is terminated.Route[]getRoutes()Returns the routes added to this job shop.JobSource[]getSources()Gets the job sources in this shop as an array.intgetStopAfterNumJobs()Returns the number of jobs to complete before the simulation is ended.WorkStationgetWorkstationByName(String name)Returns a workstation with the given name, ornullif no such workstation exists.voidinit()voidinstallMachineListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent> listener, boolean cloneIfPossible)Adds a listener to allWorkStations in the shop.booleanisEnableLookAhead()Returns the status of lookahead mechanism.voidjobFinished(Job j)SimComponentContainermachines()Returns theSimComponentContainercontaining allWorkStations of this shop.voidproduceResults(Map<String,Object> res)voidremoveJobSource(JobSource js)voidremoveMachine(WorkStation machine)Removes a machine from this shop.voidremoveRoute(Route r)voidsetEnableLookAhead(boolean enableLookAhead)Enable the lookahead mechanism of this shop.voidsetMachines(WorkStation[] machines)Sets the workstations of this shop.voidsetMaxJobsInSystem(int maxJobsInSystem)End simulation if WIP (work in process) reaches this value (0: no limit)voidsetRoutes(Route[] routes)Sets the routes available for this job shop.voidsetSources(JobSource[] sources)Sets all job sources in this shop.voidsetStopAfterNumJobs(int stopAfterNumJobs)End simulation if a certain number of jobs was completed (%lt;=0 (default): no limit).SimComponentContainersources()Returns theSimComponentContainercontaining allJobSources of this shop.voidstartJob(Job nextJob)-
Methods inherited from class jasima.core.simulation.SimComponentContainerBase
addChild, addComponent, getChild, getChildByName, getChildren, numChildren, removeChild, removeChildren
-
Methods inherited from class jasima.core.simulation.SimComponentBase
getHierarchicalName, getName, getParent, getSim, isInitialized, notifierImpl, setInitialized, setName, setNameInternal, setParent, setSim, toString, valueStoreImpl
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jasima.core.util.observer.Notifier
addListener, addListener, addListener, fire, fire, getListener, numListener, removeCurrentListener, removeListener
-
Methods inherited from interface jasima.core.simulation.SimComponent
addResult, containsChild, done, getHierarchicalName, getName, getParent, getSim, handleOther, inform, isInitialized, isValidName, notifierImpl, resetStats, setInitialized, setName, setParent, setSim, simEnd, simStart, valueStoreImpl
-
Methods inherited from interface jasima.core.simulation.SimComponentContainer
componentSetHelper, getByHierarchicalName
-
Methods inherited from interface jasima.core.simulation.util.SimOperations
activateEntity, currentPrio, end, getRootComponent, initRndGen, initRndGen, isEndRequested, isTraceEnabled, schedule, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, schedulePeriodically, schedulePeriodically, scheduleProcess, scheduleProcess, simTime, simTimeAbs, simTimeToInstant, toSimTime, toSimTime, toSimTime, trace
-
Methods inherited from interface jasima.core.util.ValueStore
valueStoreContains, valueStoreGet, valueStoreGet, valueStoreGetAllKeys, valueStoreGetNumKeys, valueStorePut, valueStoreRemove, valueStoreUpdate
-
-
-
-
Method Detail
-
init
public void init()
-
jobFinished
public void jobFinished(Job j)
-
startJob
public void startJob(Job nextJob)
-
installMachineListener
public void installMachineListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent> listener, boolean cloneIfPossible)
Adds a listener to allWorkStations in the shop.- Parameters:
listener- The machine listener to add.cloneIfPossible- whether to try to clone a new instance for each machine usingTypeUtil.cloneIfPossible(Object).
-
isEnableLookAhead
public boolean isEnableLookAhead()
Returns the status of lookahead mechanism.- Returns:
- Whether lookahead is used.
-
setEnableLookAhead
public void setEnableLookAhead(boolean enableLookAhead)
Enable the lookahead mechanism of this shop. If enabled dispatching rules can select jobs arriving from in the near future.- Parameters:
enableLookAhead- Whether to enable or disable lookahead.
-
setMaxJobsInSystem
public void setMaxJobsInSystem(int maxJobsInSystem)
End simulation if WIP (work in process) reaches this value (0: no limit)- Parameters:
maxJobsInSystem- The maximum number of jobs in the system.
-
getMaxJobsInSystem
public int getMaxJobsInSystem()
Returns the maximum number of jobs in the system, before the simulation is terminated.- Returns:
- The maximum number of jobs in the system.
-
setStopAfterNumJobs
public void setStopAfterNumJobs(int stopAfterNumJobs)
End simulation if a certain number of jobs was completed (%lt;=0 (default): no limit).- Parameters:
stopAfterNumJobs- The number of jobs to finish.
-
getStopAfterNumJobs
public int getStopAfterNumJobs()
Returns the number of jobs to complete before the simulation is ended.- Returns:
- The number of jobs to complete before terminating the simulation.
-
getSources
public JobSource[] getSources()
Gets the job sources in this shop as an array.- Returns:
- An array of job sources.
- See Also:
sources
-
sources
public SimComponentContainer sources()
Returns theSimComponentContainercontaining allJobSources of this shop.- Returns:
- The container object.
-
setSources
public void setSources(JobSource[] sources)
Sets all job sources in this shop.- Parameters:
sources- An array with all job sources.
-
addJobSource
public void addJobSource(JobSource js)
-
removeJobSource
public void removeJobSource(JobSource js)
-
getMachines
public WorkStation[] getMachines()
Gets an array of the workstations contained in this shop.- Returns:
- An array of all workstations of this shop.
- See Also:
machines()
-
machines
public SimComponentContainer machines()
Returns theSimComponentContainercontaining allWorkStations of this shop.- Returns:
- The container object.
-
setMachines
public void setMachines(WorkStation[] machines)
Sets the workstations of this shop.- Parameters:
machines- An array containing all workstations for this shop.
-
addMachine
public void addMachine(WorkStation machine)
Adds a single machine to this shop.- Parameters:
machine- The workstation to add.- See Also:
getMachines()
-
removeMachine
public void removeMachine(WorkStation machine)
Removes a machine from this shop.- Parameters:
machine- The workstation to remove.
-
getWorkstationByName
public WorkStation getWorkstationByName(String name)
Returns a workstation with the given name, ornullif no such workstation exists.- Parameters:
name- The workstation's name.- Returns:
- The workstation with the given name, if it exists.
nullotherwise.
-
getRoutes
public Route[] getRoutes()
Returns the routes added to this job shop. Do not modify externally.- Returns:
- An array of all routes in this shop.
-
setRoutes
public void setRoutes(Route[] routes)
Sets the routes available for this job shop.- Parameters:
routes- The route list.
-
addRoute
public void addRoute(Route r)
-
removeRoute
public void removeRoute(Route r)
-
clone
public Shop clone()
Description copied from interface:SimComponentPublic clone method. Implementing classes should implement a suitable functionality or throw aCloneNotSupportedExceptionwrapped in aRuntimeException.- Specified by:
clonein interfaceSimComponent- Specified by:
clonein interfaceSimComponentContainer- Overrides:
clonein classSimComponentContainerBase
-
-