Package xdevs.core.examples.dynamic
Class Machine
- java.lang.Object
-
- xdevs.core.modeling.Component
-
- xdevs.core.modeling.Atomic
-
- xdevs.core.examples.dynamic.Machine
-
public class Machine extends Atomic
Machine class for the Factory example. The machine has two output ports: oJobSolved and oJobIgnored. The machine has one input port: iJob. When a job arrives, the machine starts processing it. If the machine is already processing a job, the new job is ignored and sent through the oJobIgnored port.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
busyTime
protected Job
ignoringJob
Port<Job>
iJob
Port<Job>
oJobIgnored
Port<Job>
oJobSolved
static String
PHASE_BUSY
static String
PHASE_BUSY_IGNORING
static String
PHASE_IDLE
protected Job
processingJob
protected double
processingTime
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deltext(double e)
External transition method of the atomic model.void
deltint()
Internal transition method of the atomic model.void
exit()
Exit function.void
initialize()
Initialize the component.void
lambda()
Output function of the atomic model.-
Methods inherited from class xdevs.core.modeling.Atomic
activate, deltcon, getPhase, getSigma, holdIn, passivate, passivate, passivateIn, phaseIs, resume, setPhase, setSigma, showState, ta, toXml
-
Methods inherited from class xdevs.core.modeling.Component
addInPort, addOutPort, getInPort, getInPorts, getName, getOutPort, getOutPorts, getParent, isInputEmpty, setParent, toString
-
-
-
-
Field Detail
-
PHASE_IDLE
public static final String PHASE_IDLE
- See Also:
- Constant Field Values
-
PHASE_BUSY
public static final String PHASE_BUSY
- See Also:
- Constant Field Values
-
PHASE_BUSY_IGNORING
public static final String PHASE_BUSY_IGNORING
- See Also:
- Constant Field Values
-
processingTime
protected double processingTime
-
busyTime
protected double busyTime
-
processingJob
protected Job processingJob
-
ignoringJob
protected Job ignoringJob
-
-
Constructor Detail
-
Machine
public Machine(String name, double processingTime)
-
-
Method Detail
-
initialize
public void initialize()
Description copied from class:Component
Initialize the component. The initialize method is called when the simulation starts. The initialize method is used to initialize the component before the simulation starts.- Specified by:
initialize
in classComponent
-
exit
public void exit()
Description copied from class:Component
Exit function. The exit function is called when the simulation ends. The exit function is used to release resources used by the component.
-
deltint
public void deltint()
Description copied from class:Atomic
Internal transition method of the atomic model. This method is called when the time until the next internal transition of the model is zero.
-
deltext
public void deltext(double e)
Description copied from class:Atomic
External transition method of the atomic model. This method is called when the model receives an input from another model.
-
-