Package nl.tue.id.oocsi

# Class OOCSIDouble

java.lang.Object
nl.tue.id.oocsi.client.behavior.OOCSISystemCommunicator<T>
nl.tue.id.oocsi.client.data.OOCSIVariable<java.lang.Double>
nl.tue.id.oocsi.OOCSIDouble

    public class OOCSIDouble
    extends OOCSIVariable<java.lang.Double>

OOCSIDouble is a system-level primitive that allows for automatic synchronizing of local variables (read and write) with different OOCSI clients on the same channel. This realizes synchronization on a single data variable without aggregation.

Author:
  matsfunk

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class nl.tue.id.oocsi.client.behavior.OOCSISystemCommunicator

  `OOCSISystemCommunicator.SystemFilter<K>`

- ## Field Summary

  ### Fields inherited from class nl.tue.id.oocsi.client.data.OOCSIVariable

  `forwarders, lastInput, max, mean, min, sigma, values, windowLength`

  ### Fields inherited from class nl.tue.id.oocsi.client.behavior.OOCSISystemCommunicator

  `channelName, client, HANDLE`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `OOCSIDouble​(double referenceValue, int timeout)` |
  `OOCSIDouble​(OOCSIClient client, java.lang.String channelName, java.lang.String key)` |
  `OOCSIDouble​(OOCSIClient client, java.lang.String channelName, java.lang.String key, double referenceValue)` |
  `OOCSIDouble​(OOCSIClient client, java.lang.String channelName, java.lang.String key, double referenceValue, int timeout)` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `protected java.lang.Double` | `adapt​(java.lang.Double var)` | adaptation of the variable based on the recent history (values) and the newly entered variable setting
  `void` | `connect​(OOCSIVariable<java.lang.Double> forward)` | connect the given variable to this variable, so whenever this variable is set, the connected given variable will be set as well
  `void` | `disconnect​(OOCSIVariable<java.lang.Double> forward)` | disconnect the given variable from this variable; no more events will be sent
  `protected java.lang.Double` | `extractValue​(OOCSIEvent event, java.lang.String key)` | safely extract the message value in the right type
  `protected java.lang.Double` | `filter​(java.lang.Double var)` | filter the newly entered variable setting (if variable type is numerical, this could be a min/max filter and additional filtering based on the standard deviation, or a different filter)
  `OOCSIDouble` | `generator​(long periodMS)` | creates a periodic feedback loop that feed either the last input value or the reference value into the variable (locally).
  `OOCSIDouble` | `generator​(long periodMS, java.lang.String outputChannel, java.lang.String outputKey)` | creates a periodic feedback loop that feed either the last input value or the reference value into the variable (locally).
  `java.lang.Double` | `get()` | retrieve the current value of the variable (will check for expiration if a timeout is given; in this case the reference value is set)
  `OOCSIDouble` | `limit​(int rate, int seconds)` | set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
  `OOCSIDouble` | `max​(java.lang.Double max)` | set the maximum value for (upper-)bounded variable (also possible during operation); supports chained invocation
  `OOCSIDouble` | `min​(java.lang.Double min)` | set the minimum value for (lower-)bounded variable (also possible during operation); supports chained invocation
  `OOCSIDouble` | `reference​(java.lang.Double reference)` | set the reference value (also possible during operation); supports chained invocation
  `OOCSIDouble` | `smooth​(int windowLength)` | set the length of the smoothing window, i.e., the buffer of historical values of this variable (also possible during operation, however, this will reset the buffer); supports chained invocation
  `OOCSIDouble` | `smooth​(int windowLength, java.lang.Double sigma)` | set the length of the smoothing window, i.e., the buffer of historical values of this variable (also possible during operation, however, this will reset the buffer); supports chained invocation.
  `OOCSIDouble` | `timeout​(int timeoutMS)` | set the timeout in milliseconds (also possible during operation); supports chained invocation

  ### Methods inherited from class nl.tue.id.oocsi.client.data.OOCSIVariable

  `fresh, last, localUpdate, reference, remoteUpdate, set, set, update`

  ### Methods inherited from class nl.tue.id.oocsi.client.behavior.OOCSISystemCommunicator

  `addFilter, getHandle, message, message, message, subscribe, triggerHandler, updateFilter`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### OOCSIDouble

    public OOCSIDouble​(OOCSIClient client, java.lang.String channelName, java.lang.String key)

  - ### OOCSIDouble

    public OOCSIDouble​(OOCSIClient client, java.lang.String channelName, java.lang.String key, double referenceValue)

  - ### OOCSIDouble

    public OOCSIDouble​(OOCSIClient client, java.lang.String channelName, java.lang.String key, double referenceValue, int timeout)

  - ### OOCSIDouble

    public OOCSIDouble​(double referenceValue, int timeout)

- ## Method Details

  - ### get

    public java.lang.Double get()
    Description copied from class: `OOCSIVariable`
    retrieve the current value of the variable (will check for expiration if a timeout is given; in this case the reference value is set)
    Overrides:
      `get` in class `OOCSIVariable<java.lang.Double>`
    Returns:

  - ### extractValue

    protected java.lang.Double extractValue​(OOCSIEvent event, java.lang.String key)
    Description copied from class: `OOCSIVariable`
    safely extract the message value in the right type
    Overrides:
      `extractValue` in class `OOCSIVariable<java.lang.Double>`
    Returns:

  - ### filter

    protected java.lang.Double filter​(java.lang.Double var)
    Description copied from class: `OOCSIVariable`
    filter the newly entered variable setting (if variable type is numerical, this could be a min/max filter and additional filtering based on the standard deviation, or a different filter)
    Overrides:
      `filter` in class `OOCSIVariable<java.lang.Double>`
    Returns:

  - ### adapt

    protected java.lang.Double adapt​(java.lang.Double var)
    Description copied from class: `OOCSIVariable`
    adaptation of the variable based on the recent history (values) and the newly entered variable setting
    Overrides:
      `adapt` in class `OOCSIVariable<java.lang.Double>`
    Returns:

  - ### reference

    public OOCSIDouble reference​(java.lang.Double reference)
    set the reference value (also possible during operation); supports chained invocation
    Overrides:
      `reference` in class `OOCSIVariable<java.lang.Double>`
    Parameters:
      `reference` -
    Returns:

  - ### timeout

    public OOCSIDouble timeout​(int timeoutMS)
    set the timeout in milliseconds (also possible during operation); supports chained invocation
    Overrides:
      `timeout` in class `OOCSIVariable<java.lang.Double>`
    Parameters:
      `timeoutMS` -
    Returns:

  - ### limit

    public OOCSIDouble limit​(int rate, int seconds)
    set the limiting of incoming events in terms of "rate" and "seconds" timeframe; supports chained invocation
    Overrides:
      `limit` in class `OOCSIVariable<java.lang.Double>`
    Parameters:
      `rate` -
      `seconds` -
    Returns:

  - ### min

    public OOCSIDouble min​(java.lang.Double min)
    set the minimum value for (lower-)bounded variable (also possible during operation); supports chained invocation
    Overrides:
      `min` in class `OOCSIVariable<java.lang.Double>`
    Parameters:
      `min` -
    Returns:

  - ### max

    public OOCSIDouble max​(java.lang.Double max)
    set the maximum value for (upper-)bounded variable (also possible during operation); supports chained invocation
    Overrides:
      `max` in class `OOCSIVariable<java.lang.Double>`
    Parameters:
      `max` -
    Returns:

  - ### smooth

    public OOCSIDouble smooth​(int windowLength)
    set the length of the smoothing window, i.e., the buffer of historical values of this variable (also possible during operation, however, this will reset the buffer); supports chained invocation
    Overrides:
      `smooth` in class `OOCSIVariable<java.lang.Double>`
    Parameters:
      `windowLength` -
    Returns:

  - ### smooth

    public OOCSIDouble smooth​(int windowLength, java.lang.Double sigma)
    set the length of the smoothing window, i.e., the buffer of historical values of this variable (also possible during operation, however, this will reset the buffer); supports chained invocation. the parameter sigma sets the upper bound for the standard deviation protected variable
    Overrides:
      `smooth` in class `OOCSIVariable<java.lang.Double>`
    Parameters:
      `windowLength` -
      `sigma` -
    Returns:

  - ### generator

    public OOCSIDouble generator​(long periodMS)
    creates a periodic feedback loop that feed either the last input value or the reference value into the variable (locally). If there is no reference value set, the former applies. The period is given in milliseconds.
    Overrides:
      `generator` in class `OOCSIVariable<java.lang.Double>`
    Parameters:
      `periodMS` -
    Returns:

  - ### generator

    public OOCSIDouble generator​(long periodMS, java.lang.String outputChannel, java.lang.String outputKey)
    creates a periodic feedback loop that feed either the last input value or the reference value into the variable (locally). If there is no reference value set, the former applies. The period is given in milliseconds. In addition, the new value of the variable is sent out to the channel "outputChannel" with the given key "outputKey"
    Overrides:
      `generator` in class `OOCSIVariable<java.lang.Double>`
    Parameters:
      `periodMS` -
      `outputChannel` -
      `outputKey` -
    Returns:

  - ### connect

    public void connect​(OOCSIVariable<java.lang.Double> forward)
    Description copied from class: `OOCSIVariable`
    connect the given variable to this variable, so whenever this variable is set, the connected given variable will be set as well
    Overrides:
      `connect` in class `OOCSIVariable<java.lang.Double>`

  - ### disconnect

    public void disconnect​(OOCSIVariable<java.lang.Double> forward)
    Description copied from class: `OOCSIVariable`
    disconnect the given variable from this variable; no more events will be sent
    Overrides:
      `disconnect` in class `OOCSIVariable<java.lang.Double>`