Package xdevs.core.examples.dynamic
Class Factory
- java.lang.Object
-
- xdevs.core.modeling.Component
-
- xdevs.core.modeling.Coupled
-
- xdevs.core.examples.dynamic.Factory
-
public class Factory extends Coupled
Factory with dynamic number of machines. The factory has a generator, a transducer and a variable number of machines. When a job arrives, the factory sends it to the first idle machine. If there are no idle machines, a new machine is created and incorporated to the factory.
-
-
Field Summary
Fields Modifier and Type Field Description protected ArrayList<Machine>
machines
protected int
maxMachines
protected double
processingTime
protected Transducer
transducer
-
Fields inherited from class xdevs.core.modeling.Coupled
components, eic, eoc, ic
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
boolean
structuralTransition()
This method is called by the simulator to check possible structural changes.-
Methods inherited from class xdevs.core.modeling.Coupled
addComponent, addComponentsAndCouplings, addCoupling, addCoupling, addCoupling, addCoupling, addInPort, addOutPort, countAtomicComponents, exit, flatten, getComponentByName, getComponents, getEIC, getEOC, getIC, getParent, initialize, removeComponent, setParent, toXml
-
Methods inherited from class xdevs.core.modeling.Component
getInPort, getInPorts, getName, getOutPort, getOutPorts, isInputEmpty, toString
-
-
-
-
Field Detail
-
processingTime
protected double processingTime
-
transducer
protected Transducer transducer
-
maxMachines
protected int maxMachines
-
-
Constructor Detail
-
Factory
public Factory(String name, double period, double processingTime, double observationTime, int maxMachines)
Constructor- Parameters:
name
- Factory nameperiod
- Generator periodprocessingTime
- Machine processing timeobservationTime
- Transducer observation timemaxMachines
- Maximum number of machines
-
-
Method Detail
-
structuralTransition
public boolean structuralTransition()
Description copied from class:Coupled
This method is called by the simulator to check possible structural changes.- Overrides:
structuralTransition
in classCoupled
- Returns:
- true if the model has changed its structure, false otherwise
-
main
public static void main(String[] args)
-
-