Package jasima.shopSim.core
Class ShopExperiment
- java.lang.Object
-
- jasima.core.experiment.Experiment
-
- jasima.core.simulation.SimulationExperiment
-
- jasima.shopSim.core.ShopExperiment
-
- All Implemented Interfaces:
SimOperations,Notifier<Experiment,Experiment.ExperimentEvent>,ValueStore,Serializable,Cloneable
- Direct Known Subclasses:
DynamicShopExperiment,MimacExperiment,StaticShopExperiment
public abstract class ShopExperiment extends SimulationExperiment
Base class for shop experiments. This class wraps aShop. Derived classes will typically populate the shop with machines and JobSources and add functionality to collect some statistics and produce appropriate experiment results.- Author:
- Torsten Hildebrandt
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jasima.core.experiment.Experiment
Experiment.ExperimentEvent, Experiment.ExperimentState, Experiment.UniqueNamesCheckingHashMap
-
Nested classes/interfaces inherited from interface jasima.core.simulation.util.SimOperations
SimOperations.SimEventType
-
-
Field Summary
Fields Modifier and Type Field Description protected Shopshop-
Fields inherited from class jasima.core.simulation.SimulationExperiment
sim
-
Fields inherited from class jasima.core.experiment.Experiment
aborted, DEFAULT_SEED, error, EXCEPTION, EXCEPTION_MESSAGE, EXP_ABORTED, resultMap, RUNTIME
-
-
Constructor Summary
Constructors Constructor Description ShopExperiment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMachineListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent> l)Adds a WorkStation listener to be installed on eachWorkStationin the experiment.voidaddMachineListener(String name, NotifierListener<SimComponent,SimComponent.SimComponentEvent> l)Adds a WorkStation-listener to be installed on a certainWorkStation.voidaddShopListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent> l)Adds a shop listener to be installed on the experiment'sShop.protected voidbeforeRun()This method is called immediately beforeExperiment.performRun(), but afterExperiment.init().ShopExperimentclone()protected voidconfigureShop()protected voidcreateShop()protected voidcreateSimComponents()protected ShopdoCreateShop()Factory method to create/initialize a shop object.protected voiddone()This method can be overridden to perform any required clean-up.protected voidfinish()This method gives experiments and listeners a chance to view/modify results.BatchForminggetBatchForming()protected BatchForminggetBatchForming(int i)BatchForming[]getBatchFormingRules()PRgetBatchSequencingRule()protected PRgetBatchSequencingRule(int i)PR[]getBatchSequencingRules()NotifierListener<SimComponent,SimComponent.SimComponentEvent>[]getMachineListener()Gets the complete list ofWorkStationlisteners.NotifierListener<SimComponent,SimComponent.SimComponentEvent>[]getMachineListenerSpecific(String name)Returns an array of all listeners registered for a given machine registered before using#addMachineListener(String, NotifierListener).intgetMaxJobsInSystem()PRgetSequencingRule()protected PRgetSequencingRule(int i)PR[]getSequencingRules()NotifierListener<SimComponent,SimComponent.SimComponentEvent>[]getShopListener()Gets the complete list ofShoplisteners.intgetStopAfterNumJobs()booleanisEnableLookAhead()voidsetBatchForming(BatchForming batchForming)Sets a batch forming mechanism to be used on all machines.voidsetBatchFormingRules(BatchForming[] batchFormingRules)Sets a batch forming mechanism for specific machines.voidsetBatchSequencingRule(PR batchSequencingRule)Sets a certain dispatching rule to be used for sequencing batches on all batch machines.voidsetBatchSequencingRules(PR[] batchSequencingRules)Sets a batch sequencing rule for specific machines.voidsetEnableLookAhead(boolean enableLookAhead)Enable/disable the lookahead mechanism of this shop.voidsetMachineListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent>[] machineListener)Sets a list ofWorkStationlisteners to be installed on eachWorkStation.voidsetMaxJobsInSystem(int maxJobsInSystem)End simulation if WIP (work in process) reaches this value (<=0: no limit; default is -1).voidsetSequencingRule(PR sequencingRule)Sets a certain dispatching rule to be used for sequencing jobs on all machines.voidsetSequencingRules(PR[] sequencingRules)Sets a sequencing rule for specific machines.voidsetShopListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent>[] shopListener)Sets a list ofShoplisteners to be installed on the shop.voidsetStopAfterNumJobs(int stopAfterNumJobs)End simulation if a certain number of jobs was completed (<=0 (default): no limit).-
Methods inherited from class jasima.core.simulation.SimulationExperiment
addInitAction, afterRun, createSim, getInitialSimTime, getMainProcess, getModelRoot, getSim, getSimTimeStartInstant, getSimTimeToMillisFactor, getSimulationLength, getStatsResetTime, init, initSim, performRun, print, produceResults, setInitialSimTime, setMainProcess, setModelRoot, setSimTimeStartInstant, setSimTimeToMillisFactor, setSimTimeToMillisFactor, setSimulationLength, setStatsResetTime, toSimTime
-
Methods inherited from class jasima.core.experiment.Experiment
abort, addErrorResults, addStandardResults, cancel, checkCancelledOrInterrupted, executeSubExperiment, finalActions, getError, getInitialSeed, getLogLevel, getName, getPropsWithValues, getResults, getState, handleExecutionError, isCancelled, main, nestingLevel, nestingLevel, notifierImpl, print, print, print, print, printResults, readResolve, requireState, runExperiment, runExperimentAsync, runExperimentAsync, runExperimentInternal, runTimeReal, setInitialSeed, setLogLevel, setName, starting, state, 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.util.SimOperations
activateEntity, addComponent, addResult, 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, trace
-
Methods inherited from interface jasima.core.util.ValueStore
valueStoreContains, valueStoreGet, valueStoreGet, valueStoreGetAllKeys, valueStoreGetNumKeys, valueStorePut, valueStoreRemove, valueStoreUpdate
-
-
-
-
Field Detail
-
shop
protected Shop shop
-
-
Method Detail
-
createSimComponents
protected void createSimComponents()
- Overrides:
createSimComponentsin classSimulationExperiment
-
createShop
protected void createShop()
-
doCreateShop
protected Shop doCreateShop()
Factory method to create/initialize a shop object.- Returns:
- The new
Shopinstance.
-
configureShop
protected void configureShop()
-
beforeRun
protected void beforeRun()
Description copied from class:ExperimentThis method is called immediately beforeExperiment.performRun(), but afterExperiment.init().- Overrides:
beforeRunin classSimulationExperiment
-
getSequencingRule
protected PR getSequencingRule(int i)
-
getBatchSequencingRule
protected PR getBatchSequencingRule(int i)
-
getBatchForming
protected BatchForming getBatchForming(int i)
-
done
protected void done()
Description copied from class:ExperimentThis method can be overridden to perform any required clean-up. It is executed immediately afterExperiment.afterRun(), but beforeExperiment.produceResults()andExperiment.finish().- Overrides:
donein classSimulationExperiment
-
finish
protected void finish()
Description copied from class:ExperimentThis method gives experiments and listeners a chance to view/modify results. It is called afterExperiment.produceResults().- Overrides:
finishin classExperiment
-
clone
public ShopExperiment clone()
- Overrides:
clonein classSimulationExperiment
-
setMaxJobsInSystem
public void setMaxJobsInSystem(int maxJobsInSystem)
End simulation if WIP (work in process) reaches this value (<=0: no limit; default is -1).- Parameters:
maxJobsInSystem- The maximum number of concurrent jobs allowed in the system.
-
getMaxJobsInSystem
public int getMaxJobsInSystem()
-
setEnableLookAhead
public void setEnableLookAhead(boolean enableLookAhead)
Enable/disable the lookahead mechanism of this shop. If enabled, dispatching rules can select jobs arriving in the near future (i.e., jobs already processed on an immediate predecessor machine).- Parameters:
enableLookAhead- Whether or not to enable one-stop look ahead.
-
isEnableLookAhead
public boolean isEnableLookAhead()
-
setStopAfterNumJobs
public void setStopAfterNumJobs(int stopAfterNumJobs)
End simulation if a certain number of jobs was completed (<=0 (default): no limit).- Parameters:
stopAfterNumJobs- Set the number of jobs to complete before terminating the simulation.
-
getStopAfterNumJobs
public int getStopAfterNumJobs()
-
getSequencingRule
public PR getSequencingRule()
-
setSequencingRule
public void setSequencingRule(PR sequencingRule)
Sets a certain dispatching rule to be used for sequencing jobs on all machines.- Parameters:
sequencingRule- The sequencing rule to use on all work stations.- See Also:
setSequencingRules(PR[])
-
getBatchSequencingRule
public PR getBatchSequencingRule()
-
setBatchSequencingRule
public void setBatchSequencingRule(PR batchSequencingRule)
Sets a certain dispatching rule to be used for sequencing batches on all batch machines.- Parameters:
batchSequencingRule- The batch sequencing rule to use on all work stations.- See Also:
setBatchSequencingRules(PR[])
-
getBatchForming
public BatchForming getBatchForming()
-
setBatchForming
public void setBatchForming(BatchForming batchForming)
Sets a batch forming mechanism to be used on all machines.- Parameters:
batchForming- The batch forming rule to use on all machines- See Also:
setBatchFormingRules(BatchForming[])
-
setSequencingRules
public void setSequencingRules(PR[] sequencingRules)
Sets a sequencing rule for specific machines. To use itsequencingRuleshas to contain an entry for each machine (workstation) in the model.- Parameters:
sequencingRules- An array of sequencing rule, containing onePRper work station.- See Also:
setSequencingRule(PR)
-
getSequencingRules
public PR[] getSequencingRules()
-
setBatchSequencingRules
public void setBatchSequencingRules(PR[] batchSequencingRules)
Sets a batch sequencing rule for specific machines. To use itbatchSequencingRuleshas to contain an entry for each machine (workstation) in the model.- Parameters:
batchSequencingRules- An array of batch sequencing rules, one for each workstation.- See Also:
setBatchSequencingRule(PR)
-
getBatchSequencingRules
public PR[] getBatchSequencingRules()
-
setBatchFormingRules
public void setBatchFormingRules(BatchForming[] batchFormingRules)
Sets a batch forming mechanism for specific machines. To use itbatchFormingRuleshas to contain an entry for each machine (workstation) in the model.- Parameters:
batchFormingRules- An array of batch forming rules, one for each workstation.- See Also:
setBatchForming(BatchForming)
-
getBatchFormingRules
public BatchForming[] getBatchFormingRules()
-
getShopListener
public NotifierListener<SimComponent,SimComponent.SimComponentEvent>[] getShopListener()
Gets the complete list ofShoplisteners.- Returns:
- The array of shop listeners; can be null.
-
setShopListener
public void setShopListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent>[] shopListener)
Sets a list ofShoplisteners to be installed on the shop.- Parameters:
shopListener- The listeners to install during experiment execution.
-
addShopListener
public void addShopListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent> l)
Adds a shop listener to be installed on the experiment'sShop.- Parameters:
l- The listener to install during experiment execution.
-
getMachineListener
public NotifierListener<SimComponent,SimComponent.SimComponentEvent>[] getMachineListener()
Gets the complete list ofWorkStationlisteners.- Returns:
- The array of workstation listeners. Can be null.
-
setMachineListener
public void setMachineListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent>[] machineListener)
Sets a list ofWorkStationlisteners to be installed on eachWorkStation.- Parameters:
machineListener- The listeners to install during experiment execution.
-
addMachineListener
public void addMachineListener(NotifierListener<SimComponent,SimComponent.SimComponentEvent> l)
Adds a WorkStation listener to be installed on eachWorkStationin the experiment.- Parameters:
l- The listener to install during experiment execution.
-
addMachineListener
public void addMachineListener(String name, NotifierListener<SimComponent,SimComponent.SimComponentEvent> l)
Adds a WorkStation-listener to be installed on a certainWorkStation.- Parameters:
name- The workstation's name.l- The listener to install during experiment execution.
-
getMachineListenerSpecific
public NotifierListener<SimComponent,SimComponent.SimComponentEvent>[] getMachineListenerSpecific(String name)
Returns an array of all listeners registered for a given machine registered before using#addMachineListener(String, NotifierListener).- Parameters:
name- The workstation's name.- Returns:
- An array of all listeners for the given machine name.
-
-