Utility Classes

This is a collection of utility classes that are used within various examples of ThoughtForge clients.

Behavior Interface

class thoughtforge_client.utils.behavior_interface.BehaviorInterface
This class acts as an interface for composable behaviors for use with the ThoughtForge platform. Internalizes.
the specification of network topology and interfacing with the sensors and Motors.

This function is intended to return an array of motor outputs but can be composed from separate behaviors.

This function takes the parameters from the ‘preprocessor_specification’ of the specification file, and uses it to generate an output json specification for a network topology and sensor/motor definitions

update_sensor_values(obs, reset=False)
This function takes in the observation space and returns a dictionary of sensor names and values calculated from the observation space. If Reset is true, then this indicates an interruption in the temporal steam.

Client Param Utilities

return json client configuration from the given filename

thoughtforge_client.utils.client_param_utils.safe_dict_get(dict, keyName, default)
Utility function for accessing dictionary values

Sensor and Motor Groups

class thoughtforge_client.utils.sensor_motor_groups.SensorGroup(update_function, base_sensor_name)

This is a simple abstraction to consolidate handling for a simple sensor value with possibly multiple entry points into the network.


Queries for updated sensor values and sets the sensor values appropriately.

Signals and Derivatives Utilities

Utility class for simple tracking of derivatives of sensor signal values.

Returns the current value for the requested derivative.

Reset derivative trackers to zero.

Update the derivative value chain.

Value Delta class

ValueDelta is a utility class for tracking the change in a value over time. This is commonly used in sensor definitions to get the derivative of a changing continuous value.

Indicates an interruption in the data stream.

Updates the current value of the value stream and returns the delta from last value.