demos.atomicblocks
Class DERamp

java.lang.Object
  extended by modhelxs.abstractsemantics.NamedEntity
      extended by modhelxs.abstractsemantics.ObservableEntity
          extended by modhelxs.abstractsemantics.Block
              extended by modhelxs.state_management.ManagedBlock
                  extended by modhelxs.state_management.TimedManagedBlock<java.lang.Double>
                      extended by demos.atomicblocks.DERamp
All Implemented Interfaces:
Block, NamedEntity, ObservableEntity

public class DERamp
extends TimedManagedBlock<java.lang.Double>

A DERamp is a Block which produces an increasing value on all its pins at each snapshot. The initial value is set by the "init" property (default 0), the increment is set by the "increment" property (default 1). If the "period" property (default 1.0) is not null, the DERamp will produce outputs periodically, starting at the time set by the "inittime" property (default 0.0). If the "period" property is null, the ramp will only produce its initial value at time "inittime". This block has an output pin, which is returned by its output() method.

Author:
boulange

Field Summary
private  Parameter<java.lang.Integer> increment
           
private  Pin output_
           
private  Parameter<java.lang.Double> period
           
private  Attribute<java.lang.Integer> value
           
 
Constructor Summary
DERamp(java.lang.String name, java.lang.Object... properties)
          Create a DERamp with a name and properties.
 
Method Summary
 void doEndOfSnapshot()
          The endOfSnapshot behavior of the block.
 void doSetup()
          The setup behavior of the block.
 void doUpdate()
          The update behavior of the block.
 Pin output()
          Get the default output pin of the ramp.
 
Methods inherited from class modhelxs.state_management.TimedManagedBlock
doPreSetup, doReset, doStartOfSnapshot, emitObservationRequests, getNextObservationTime, getTimeOfRequest, hasObservationRequest, initNextObservationTime, nextObsTimeAttribute, observationClock, setNextObservationTime, tagDifference, tagProduct, tagQuotient, tagSum
 
Methods inherited from class modhelxs.state_management.ManagedBlock
endOfSnapshot, endOfUpdate, initFromProperties, prep, reset, setup, startOfSnapshot, startOfUpdate, update, validate, wasUpdated, wrapup
 
Methods inherited from class modhelxs.abstractsemantics.Block
connect, connectFromInterfaceBlock, connectFromModel, connectFromRegularBlock, getEngine, getInputPins, getMoC, getOutputPins, getParent, getSolver, sanityCheck, setParent
 
Methods inherited from class modhelxs.abstractsemantics.ObservableEntity
addPin, getInterface, getPin
 
Methods inherited from class modhelxs.abstractsemantics.NamedEntity
getName, getProperties, getProperty, hasProperty, removeProperty, setName, setProperties, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface modhelxs.ecore.ObservableEntity
getInterface
 
Methods inherited from interface modhelxs.ecore.NamedEntity
getName, getProperties, setName
 

Field Detail

increment

private Parameter<java.lang.Integer> increment

period

private Parameter<java.lang.Double> period

value

private Attribute<java.lang.Integer> value

output_

private final Pin output_
Constructor Detail

DERamp

public DERamp(java.lang.String name,
              java.lang.Object... properties)
Create a DERamp with a name and properties.

Method Detail

output

public Pin output()
Get the default output pin of the ramp.


doSetup

public void doSetup()
Description copied from class: ManagedBlock
The setup behavior of the block.

Specified by:
doSetup in class ManagedBlock

doUpdate

public void doUpdate()
Description copied from class: ManagedBlock
The update behavior of the block.

Specified by:
doUpdate in class ManagedBlock

doEndOfSnapshot

public void doEndOfSnapshot()
Description copied from class: ManagedBlock
The endOfSnapshot behavior of the block.

Specified by:
doEndOfSnapshot in class ManagedBlock