fr.emn.reactiveinput.devices
Class DInertia

java.lang.Object
  extended byfr.emn.reactiveinput.AbstractDevice
      extended byfr.emn.reactiveinput.AbstractMutableDevice
          extended byfr.emn.reactiveinput.devices.DInertia
All Implemented Interfaces:
Device, MutableDevice, Processor

public class DInertia
extends AbstractMutableDevice

Author:
Pierre

Field Summary
 In grab
           
 Out grab_out
           
 In in
           
 Out out
           
 Out speed_out
           
 
Fields inherited from class fr.emn.reactiveinput.AbstractDevice
currIndex, ins, outs
 
Fields inherited from interface fr.emn.reactiveinput.Device
AUTO_PROPERTIES
 
Constructor Summary
DInertia()
           
 
Method Summary
 double getFriction()
           
 double getMinSpeed()
           
 Slot[] getMutationTriggers()
          Returns the mutation triggers for this mutable device, i.e. all input or output slots that trigger a mutation when it is connected to another type.
 boolean getRoundValues()
           
 double getSpeedSmoothing()
           
 boolean hasExternalInput()
          Specifies whether this device has external (implicit) input or not.
 void init()
          Initializes device's output values.
 void mutate()
          Perform a mutation on this device.
 void setFriction(double slidingFriction)
           
 void setMinSpeed(double minSpeed)
           
 void setRoundValues(boolean roundValues)
           
 void setSpeedSmoothing(double speedSmoothing)
           
 void update()
          Updates device's output values.
 
Methods inherited from class fr.emn.reactiveinput.AbstractMutableDevice
addMutableIn, addMutableIn, addMutableIn, addMutableOut, addMutableOut, remove
 
Methods inherited from class fr.emn.reactiveinput.AbstractDevice
addIn, addIn, addOut, close, copy, doDisable, doEnable, finalize, getError, getIndex, getInfo, getIns, getName, getOuts, getProperties, hasExternalOutput, insertAt, insertAtEnd, insertBefore, isCopiable, isEnabled, isOpenable, open, setEnabled, setInfo, setInfo, setLastError, setName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.emn.reactiveinput.Device
close, copy, getError, getInfo, getIns, getName, getOuts, getProperties, hasExternalOutput, isCopiable, isOpenable, open, setEnabled
 

Field Detail

grab

public final In grab

in

public final In in

grab_out

public final Out grab_out

out

public final Out out

speed_out

public final Out speed_out
Constructor Detail

DInertia

public DInertia()
Method Detail

hasExternalInput

public boolean hasExternalInput()
Description copied from interface: Device
Specifies whether this device has external (implicit) input or not.

Returns false if the device is deterministic from the data & time points of view, i.e. if its output production only depend on the explicit input history (input slots) and device's initial configuration. This is the case of most of the processing devices.

Return trues if output values do not only depend on the values of input slots, or if output production takes undefined time. Examples of devices with external input are input peripherals and asynchronous devices.

This method is used by the reactive machine to determine if this device is triggered by its input slots, or if it must be triggered continuously (i.e. each tick). This method can also be used by the editor for the device's graphical representation.

Specified by:
hasExternalInput in interface Device
Overrides:
hasExternalInput in class AbstractDevice

getMutationTriggers

public Slot[] getMutationTriggers()
Description copied from class: AbstractMutableDevice
Returns the mutation triggers for this mutable device, i.e. all input or output slots that trigger a mutation when it is connected to another type.

Specified by:
getMutationTriggers in interface MutableDevice
Specified by:
getMutationTriggers in class AbstractMutableDevice

mutate

public void mutate()
Description copied from class: AbstractMutableDevice
Perform a mutation on this device. This method is called when a connection is made (or deleted) on an entry point.

Add mutation code here.

Specified by:
mutate in interface MutableDevice
Specified by:
mutate in class AbstractMutableDevice

init

public void init()
Description copied from class: AbstractDevice
Initializes device's output values.

Subclass init() and update() methods if you want the device to process the data itself. Otherwise, subclass getProcessor() method to use extern processors. By default, this method calls update(). Subclass this method if you'd like to make a specific initialization routine.

Specified by:
init in interface Processor
Overrides:
init in class AbstractDevice
See Also:
Processor.init()

update

public void update()
Description copied from class: AbstractDevice
Updates device's output values.

Subclass init() and update() methods if you want the device to process the data itself. Otherwise, subclass getProcessor() method to use extern processors.

Specified by:
update in interface Processor
Overrides:
update in class AbstractDevice
See Also:
Processor.update()

getSpeedSmoothing

public double getSpeedSmoothing()
Returns:
Returns the speedSmoothing.

setSpeedSmoothing

public void setSpeedSmoothing(double speedSmoothing)
Parameters:
speedSmoothing - The speedSmoothing to set.

getRoundValues

public boolean getRoundValues()
Returns:
Returns the roundValues.

setRoundValues

public void setRoundValues(boolean roundValues)
Parameters:
roundValues - The roundValues to set.

getFriction

public double getFriction()
Returns:
Returns the slidingFriction.

setFriction

public void setFriction(double slidingFriction)
Parameters:
slidingFriction - The slidingFriction to set.

getMinSpeed

public double getMinSpeed()
Returns:
Returns the minSpeed.

setMinSpeed

public void setMinSpeed(double minSpeed)
Parameters:
minSpeed - The minSpeed to set.