Package xdevs.core.examples.devstone
Class DevStoneGenerator
- java.lang.Object
-
- xdevs.core.modeling.Component
-
- xdevs.core.modeling.Atomic
-
- xdevs.core.examples.devstone.DevStoneGenerator
-
public class DevStoneGenerator extends Atomic
Events generator for the DEVStone benchmark
-
-
Constructor Summary
Constructors Constructor Description DevStoneGenerator(String name, double preparationTime, double period, int maxEvents)
ConstructorDevStoneGenerator(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.int
getMaxEvents()
Get the maximum number of events to generatedouble
getPeriod()
Get the perioddouble
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
-
preparationTime
protected double preparationTime
Preparation time. Time to prepare the atomic model before the execution of the output and internal transition functions.
-
period
protected double period
Period. Time between consecutive output events.
-
counter
protected int counter
Counter of events
-
maxEvents
protected int maxEvents
Maximum number of events to generate
-
-
Constructor Detail
-
DevStoneGenerator
public DevStoneGenerator(String name, double preparationTime, double period, int maxEvents)
Constructor- Parameters:
name
- name of the modelpreparationTime
- preparation timeperiod
- periodmaxEvents
- maximum number of events to generate
-
DevStoneGenerator
public DevStoneGenerator(Element xmlAtomic)
Constructor- Parameters:
xmlAtomic
- XML element with the description of 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.
-
getPeriod
public double getPeriod()
Get the period- Returns:
- period
-
getMaxEvents
public int getMaxEvents()
Get the maximum number of events to generate- Returns:
- maximum number of events
-
getPreparationTime
public double getPreparationTime()
Get the preparation time- Returns:
- preparation time
-
-