Package xdevs.core.examples.devstone
Class DevStoneAtomic
- java.lang.Object
-
- xdevs.core.modeling.Component
-
- xdevs.core.modeling.Atomic
-
- xdevs.core.examples.devstone.DevStoneAtomic
-
public class DevStoneAtomic extends Atomic
DEVStone atomic model
-
-
Field Summary
Fields Modifier and Type Field Description protected Dhrystone
dhrystone
Dhrystone benchmark.protected double
extDelayTime
External delay time.Port<Integer>
iIn
Input portprotected double
intDelayTime
Internal delay time.long
numDeltExts
Number of external transitions performedlong
numDeltInts
Number of internal transitions performedlong
numOfEvents
Number of events receivedPort<Integer>
oOut
Output portprotected double
preparationTime
Preparation time.
-
Constructor Summary
Constructors Constructor Description DevStoneAtomic(String name, double preparationTime, double intDelayTime, double extDelayTime)
ConstructorDevStoneAtomic(String name, double preparationTime, org.apache.commons.math3.distribution.RealDistribution distribution)
ConstructorDevStoneAtomic(Element xmlAtomic)
Constructor
-
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.double
getExtDelayTime()
Get the external delay timedouble
getIntDelayTime()
Get the internal delay timedouble
getPreparationTime()
Get the preparation timevoid
initialize()
Initialize the component.void
lambda()
Output function of the atomic model.String
toXml()
Method to get the XML representation of the model.-
Methods inherited from class xdevs.core.modeling.Atomic
activate, deltcon, getPhase, getSigma, holdIn, passivate, passivate, passivateIn, phaseIs, resume, setPhase, setSigma, showState, ta
-
Methods inherited from class xdevs.core.modeling.Component
addInPort, addOutPort, getInPort, getInPorts, getName, getOutPort, getOutPorts, getParent, isInputEmpty, setParent, toString
-
-
-
-
Field Detail
-
dhrystone
protected Dhrystone dhrystone
Dhrystone benchmark. This benchmark is executed while the atomic model is in delay mode.
-
preparationTime
protected double preparationTime
Preparation time. Time to prepare the atomic model before the execution of the output and internal transition functions.
-
intDelayTime
protected double intDelayTime
Internal delay time. Time to execute the internal transition function.
-
extDelayTime
protected double extDelayTime
External delay time. Time to execute the external transition function.
-
numDeltInts
public long numDeltInts
Number of internal transitions performed
-
numDeltExts
public long numDeltExts
Number of external transitions performed
-
numOfEvents
public long numOfEvents
Number of events received
-
-
Constructor Detail
-
DevStoneAtomic
public DevStoneAtomic(String name, double preparationTime, double intDelayTime, double extDelayTime)
Constructor- Parameters:
name
- name of the modelpreparationTime
- preparation timeintDelayTime
- internal delay timeextDelayTime
- external delay time
-
DevStoneAtomic
public DevStoneAtomic(String name, double preparationTime, org.apache.commons.math3.distribution.RealDistribution distribution)
Constructor- Parameters:
name
- name of the modelpreparationTime
- preparation timedistribution
- distribution to generate the internal and external delay times
-
DevStoneAtomic
public DevStoneAtomic(Element xmlAtomic)
Constructor- Parameters:
xmlAtomic
- XML element with the atomic model
-
-
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.
-
lambda
public void lambda()
Description copied from class:Atomic
Output function of the atomic model. This method is called when the model has an output to send to another model.
-
getPreparationTime
public double getPreparationTime()
Get the preparation time- Returns:
- preparation time
-
getIntDelayTime
public double getIntDelayTime()
Get the internal delay time- Returns:
- internal delay time
-
getExtDelayTime
public double getExtDelayTime()
Get the external delay time- Returns:
- external delay time
-
-