net.simplace.sim.components.util.SimpleCounter

Provides a resettable counter of simulation days.

Counting

Counter is incremented, if the input variable iDoCount is true.

Resetting the counter

If iReset is true, the counter is reset before an potential increment.

Customization

Increment and start value are customizable. Default increment is 1, start value is 0.

Component Variables

Content TypeNameDescriptionData TypeUnitMin ValueMax ValueDefault Value
constantcIncrementincrement of counterINT--1
constantcStartValuestart value of counterINT--0
inputiDoCountcounter is incremented if trueBOOLEAN--false
inputiResetresets the counter to its start value if trueBOOLEAN--false
outCounteractual value of the counterINT--0
outNumberOfResetsnumber of resetsINT--0
outTotalCounttotal count starting from 0 and incremented by 1INT--0



public class SimpleCounter extends net.simplace.sim.model.FWSimComponent {
// Public Constructors
public SimpleCounter();


// Public Instance Methods
public HashMap createVariables(); // Defines
net.simplace.sim.model.FWSimComponent


Create the FWSimVariables as interface for this SimComponent

// Protected Instance Methods
protected void init(); // Defines net.simplace.sim.model.FWSimComponent

Initializes the fields by getting input and output FWSimVariables from VarMap
protected void process(); // Defines net.simplace.sim.model.FWSimComponent

Process the algorithm and write the results back to VarMap
protected FWSimComponent clone(FWSimVarMap aVarMap);
// Defines net.simplace.sim.model.FWSimComponent


creates a clone from this SimComponent for use in other threads


}



Hierarchy: java.lang.Object - net.simplace.sim.model.FWSimComponent (net.simplace.sim.util.FWSimFieldContainer) - SimpleCounter