Package xdevs.core.examples.efp
Class Transducer
- java.lang.Object
-
- xdevs.core.modeling.Component
-
- xdevs.core.modeling.Atomic
-
- xdevs.core.examples.efp.Transducer
-
public class Transducer extends Atomic
Transducer The transducer collects statistics about the jobs. It also finishes the simulation when the observation time is reached.
-
-
Field Summary
Fields Modifier and Type Field Description protected doubleclockInternal clock.Port<Job>iArrivedInput port for arrived jobs.Port<Job>iSolvedInput port for solved jobs.protected LinkedList<Job>jobsArrivedJobs arrived.protected LinkedList<Job>jobsSolvedJobs processed.protected doubleobservationTimeObservation time before finishing the simulation.Port<Job>oOutOutput port to finish the simulation.protected doubletotalTaTotal time consumed by the jobs.
-
Constructor Summary
Constructors Constructor Description Transducer(String name, double observationTime)ConstructorTransducer(Element xmlAtomic)Constructor from XML
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeltext(double e)External transition method of the atomic model.voiddeltint()Internal transition method of the atomic model.voidexit()Exit function.voidinitialize()Initialize the component.voidlambda()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
-
jobsArrived
protected LinkedList<Job> jobsArrived
Jobs arrived.
-
jobsSolved
protected LinkedList<Job> jobsSolved
Jobs processed.
-
observationTime
protected double observationTime
Observation time before finishing the simulation.
-
totalTa
protected double totalTa
Total time consumed by the jobs.
-
clock
protected double clock
Internal clock.
-
-
Method Detail
-
initialize
public void initialize()
Description copied from class:ComponentInitialize 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:
initializein classComponent
-
exit
public void exit()
Description copied from class:ComponentExit 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:AtomicInternal 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:AtomicExternal transition method of the atomic model. This method is called when the model receives an input from another model.
-
-