Skip to content

Module helics.capi

Classes

HelicsBroker

class HelicsBroker(handle)

Base classes

  • helics.capi._HelicsCHandle

Instance attributes

  • address Get the connection address for the broker.

  • identifier Get the local identification for the broker.

  • name Get the local identification for the broker.


Methods

add_destination_filter_to_endpoint

def add_destination_filter_to_endpoint(self, filter: str, target: str)

Create a filter connection between a named filter and a named endpoint for destination processing.

Parameters

  • filter: the name of the filter.
  • target: the name of the source target.

add_source_filter_to_endpoint

def add_source_filter_to_endpoint(self, filter: str, target: str)

Create a filter connection between a named filter and a named endpoint for messages coming from that endpoint.

Parameters

filter: the name of the filter. target: the name of the source target.


data_link

def data_link(self, source: str, target: str)

Create a data link between a named publication and a named input.

Parameters

  • source: the name of the publication.
  • target: the name of the input.

disconnect

def disconnect(self)

Disconnect the broker from any other brokers and communications.


global_error

def global_error(self, error_code: int, error_string: str)

Generate a global error to terminate the federation.

Parameters

  • error_code: an error code to give to the error.
  • error_string: a string message associated with the error.

is_connected

def is_connected(self)

Check if the broker is connected.


query

def query(self, target: str, query: str, mode: HelicsSequencingMode = HelicsSequencingMode.FAST) -> JSONType

Make a query of the broker.

This call is blocking until the value is returned which may take some time depending on the size of the federation and the specific string being queried.

Parameters

  • target: the target of the query can be “federation”, “federate”, “broker”, “core”, or a specific name of a federate, core, or broker.
  • query: a string with the query, see other documentation for specific properties to query, can be defined by the federate.

Returns: a string with the value requested. This is either going to be a vector of strings value or a JSON string stored in the first element of the vector. The string “#invalid” is returned if the query was not valid.


set_global

def set_global(self, name: str, value: str)

Set a federation global value.

This overwrites any previous value for this name. globals can be queried with a target of “global” and query of the value to Query.

Parameters

  • name: the name of the global to set.
  • value: the value of the global.

wait_for_disconnect

def wait_for_disconnect(self, ms_to_wait: int = -1)

Waits in the current thread until the broker is disconnected.

Parameters

  • ms_to_wait: the timeout to wait for disconnect (-1) implies no timeout

Returns: True if the disconnect was successful false if it timed out


HelicsCloningFilter

class HelicsCloningFilter(handle)

Base classes


Instance attributes

  • info Get the interface information field of the filter.

  • name


HelicsCombinationFederate

class HelicsCombinationFederate(handle)

Base classes


Instance attributes

  • core

  • current_time

  • n_endpoints

  • n_filters

  • n_inputs

  • n_pending_messages Returns the number of pending receives for all endpoints.

  • n_publications Get the number of publications in this federate.

  • n_subscriptions Get the number of inputs in this federate.

  • name

  • separator

  • state


HelicsCore

class HelicsCore(handle)

Base classes

  • helics.capi._HelicsCHandle

Instance attributes

  • address Get the connection network or connection address for the core.

  • identifier Get an identifier string for the core.


Methods

clone

def clone(self)

disconnect

def disconnect(self)

Disconnect the core from its broker.


global_error

def global_error(self, error_code: int, error_string: str)

Generate a global error to terminate the federation.

Parameters

  • error_code: an error code to give to the error.
  • error_string: a string message associated with the error.

is_connected

def is_connected(self) -> bool

Check if the core is connected to the broker.


is_valid

def is_valid(self) -> bool

Check if the core is valid.


query

def query(self, target: str, query: str) -> JSONType

Make a query of the core.

This call is blocking until the value is returned which may take some time depending on the size of the federation and the specific string being queried

target: the target of the query can be “federation”, “federate”, “broker”, “core”, or a specific name of a federate, core, or broker query: a string with the query, see other documentation for specific properties to query, can be defined by the federate

Returns: a string with the value requested. this is either going to be a vector of strings value or a JSON string stored in the first element of the vector. The string “#invalid” is returned if the query was not valid


register_cloning_filter

def register_cloning_filter(self, delivery_endpoint: str) -> HelicsCloningFilter

Create a cloning Filter on the specified federate.

Cloning filters copy a message and send it to multiple locations source and destination can be added through other functions

Parameters

delivery_endpoint: the specified endpoint to deliver the message

Returns: a helics.HelicsFilter object.


register_filter

def register_filter(self, kind: HelicsFilterType, name: str = "") -> HelicsFilter

Create a destination Filter on the specified federate.

Filters can be created through a federate or a core , linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise equivalent behavior

kind: the type of filter to create name: the name of the filter (can be NULL)

Returns: a helics.HelicsFilter object.


set_global

def set_global(self, name: str, value: str)

Set a global federation value.

Parameters

name: the name of the global value to set value: actual value of the global variable


set_ready_to_init

def set_ready_to_init(self)

Set the core to ready to enter init.

This function only needs to be called for cores that don’t have any federates but may have filters for cores with federates it won’t do anything.


wait_for_disconnect

def wait_for_disconnect(self, ms_to_wait: int = -1) -> bool

Waits in the current thread until the broker is disconnected

Parameters

ms_to_wait: the timeout to wait for disconnect (-1) implies no timeout

Returns: true if the disconnect was successful false if it timed out.


HelicsCoreType

class HelicsCoreType(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • DEFAULT = 0
  • TEST = 3
  • INTERPROCESS = 4
  • IPC = 5
  • TCP = 6
  • UDP = 7
  • NNG = 9
  • ZMQ_TEST = 10
  • TCP_SS = 11
  • HTTP = 12
  • WEBSOCKET = 14
  • INPROC = 18
  • NULL = 66

Base classes

  • enum.IntEnum

HelicsDataType

class HelicsDataType(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • STRING = 0
  • DOUBLE = 1
  • INT = 2
  • COMPLEX = 3
  • VECTOR = 4
  • COMPLEX_VECTOR = 5
  • NAMED_POINT = 6
  • BOOLEAN = 7
  • TIME = 8
  • RAW = 25
  • MULTI = 33
  • ANY = 25262

Base classes

  • enum.IntEnum

HelicsEndpoint

class HelicsEndpoint(handle)

Base classes

  • helics.capi._HelicsCHandle

Instance attributes

  • default_destination Get the default destination for an endpoint.

  • info Get the interface information field of the filter.

  • n_pending_messages Returns the number of pending receives for endpoint.

  • name Get the name of the endpoint.

  • type Get the specified type of the endpoint.


Methods

create_message

def create_message(self) -> HelicsMessage

Create a message object.


get_message

def get_message(self) -> HelicsMessage

Get a packet from an endpoint.


has_message

def has_message(self) -> bool

Checks if endpoint has unread messages.


is_valid

def is_valid(self) -> bool

Check if the input is valid.


send_data

def send_data(self, data: Union[bytes, HelicsMessage], destination: str = None, time=None)

HelicsError

class HelicsError(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • FATAL = -404
  • EXTERNAL_TYPE = -203
  • OTHER = -101
  • INSUFFICIENT_SPACE = -18
  • EXECUTION_FAILURE = -14
  • INVALID_FUNCTION_CALL = -10
  • INVALID_STATE_TRANSITION = -9
  • WARNING = -8
  • SYSTEM_FAILURE = -6
  • DISCARD = -5
  • INVALID_ARGUMENT = -4
  • INVALID_OBJECT = -3
  • CONNECTION_FAILURE = -2
  • REGISTRATION_FAILURE = -1
  • OK = 0

Base classes

  • enum.IntEnum

HelicsException

class HelicsException(self, *args, **kwargs)

Common base class for all non-exit exceptions.


Base classes

  • builtins.Exception

HelicsFederate

class HelicsFederate(self, handle)

Initialize self. See help(type(self)) for accurate signature.


Base classes

  • helics.capi._HelicsCHandle

Instance attributes

  • core

  • current_time

  • n_endpoints

  • n_filters

  • n_inputs

  • n_pending_messages Returns the number of pending receives for all endpoints.

  • n_publications

  • name

  • separator

  • state


Methods

add_dependency

def add_dependency(self, federate_name)

Add a dependency for this federate.

Adds an additional internal time dependency for the federate.

Parameters

  • fed_name: the name of the federate to add a dependency on.

disconnect

def disconnect(self)

Terminate the simulation.

Call is will block until the disconnect has been acknowledged, no commands that interact with the core may be called after this function function.


disconnect_async

def disconnect_async(self)

Terminate the simulation in a non-blocking call. self.disconnect_complete() must be called after this call to complete the disconnect procedure.


disconnect_complete

def disconnect_complete(self)

Complete the asynchronous terminate pair.


enter_executing_mode

def enter_executing_mode(self, iterate: HelicsIterationRequest = HelicsIterationRequest.NO_ITERATION)

Enter the normal execution mode.

Call will block until all federates have entered this mode.

Parameters

  • iterate: An optional flag indicating the desired iteration mode.

enter_executing_mode_async

def enter_executing_mode_async(self, iterate: HelicsIterationRequest = HelicsIterationRequest.NO_ITERATION)

Enter the normal execution mode.

Call will return immediately but enter_executing_mode_complete should be called to complete the operation.

Parameters

  • iterate: An optional flag indicating the desired iteration mode.

enter_executing_mode_complete

def enter_executing_mode_complete(self)

Complete the async call for entering Execution state.

Call will not block but will return quickly. The enter_initializing_mode_complete must be called before doing other operations.


enter_initializing_mode

def enter_initializing_mode(self)

Enter the initialization mode after all interfaces have been defined.

The call will block until all federates have entered initialization mode.


enter_initializing_mode_async

def enter_initializing_mode_async(self)

Enter the initialization mode after all interfaces have been defined.

The call will not block but a call to enter_initializing_mode_complete should be made to complete the call sequence.


enter_initializing_mode_complete

def enter_initializing_mode_complete(self)

Second part of the async process for entering initializationState call after a call to enter_initializing_mode_async if call any other time it will throw an InvalidFunctionCall exception


finalize

def finalize(self)

Terminate the simulation.

Call is will block until the finalize has been acknowledged, no commands that interact with the core may be called after this function function.


finalize_async

def finalize_async(self)

Terminate the simulation in a non-blocking call. self.finalize_complete() must be called after this call to complete the finalize procedure.


finalize_complete

def finalize_complete(self)

Complete the asynchronous terminate pair.


get_filter_by_index

def get_filter_by_index(self, filter_index)

Get a filter by index.

Parameters

  • index: the index of a filter.

Returns: A reference to a filter object which could be invalid if filter_name is not valid.


get_filter_by_name

def get_filter_by_name(self, filter_name)

Get the id of a source filter from the name of the endpoint.

Parameters

  • filter_name: the name of the filter.

Returns: a reference to a filter object which could be invalid if filter_name is not valid.


global_error

def global_error(self, error_code: int, error_string: str)

Generate a global error to terminate the federation.

Parameters

  • error_code: an error code to give to the error.
  • error_string: a string message associated with the error.

is_async_operation_completed

def is_async_operation_completed(self)

Called after one of the async calls and will indicate true if an async operation has completed. Only call from the same thread as the one that called the initial async call and will return false if called when no aysnc operation is in flight


local_error

def local_error(self, error_code: int, error_string: str)

Generate a local federate error.

Parameters

  • error_code: an error code to give to the error.
  • error_string: a string message associated with the error.

log_message

def log_message(self, message: str, level: HelicsLogLevel)

Log an message.


query

def query(self, target: str, query: str) -> JSONType

Make a query of the federate.

This call is blocking until the value is returned which make take some time depending on the size of the federation and the specific string being queried.

Parameters

  • target: the target of the query can be “federation”, “federate”, “broker”, “core”, or a specific name of a federate, core, or broker.
  • query: a string with the query see other documentation for specific properties to query, can be defined by the federate.

Returns: a string with the value requested. this is either going to be a vector of strings value or a JSON string stored in the first element of the vector. The string “#invalid” is returned if the query was not valid.


register_cloning_filter

def register_cloning_filter(self, delivery_endpoint: str) -> HelicsCloningFilter

Create a HelicsCloningFilter on the specified federate.

Cloning filters copy a message and send it to multiple locations source and destination can be added through other functions.

Parameters

  • delivery_endpoint: the specified endpoint to deliver the message.

Returns: A HelicsCloningFilter object.


register_filter

def register_filter(self, kind: HelicsFilterType, filter_name: str) -> HelicsFilter

Define a filter interface.

A filter will modify messages coming from or going to target endpoints.

Parameters

  • kind: the type of the filter to register.
  • filter_name: the name of the filter.

register_global_cloning_filter

def register_global_cloning_filter(self, delivery_endpoint: str) -> HelicsCloningFilter

Create a cloning Filter on the specified federate

Cloning filters copy a message and send it to multiple locations source and destination can be added through other functions.

Parameters

  • delivery_endpoint: the specified endpoint to deliver the message.

Returns: A CloningFilter object.


register_global_filter

def register_global_filter(self, kind: HelicsFilterType, filter_name: str) -> HelicsFilter

Define a filter interface.

A filter will modify messages coming from or going to target endpoints.

Parameters

  • kind: the type of the filter to register.
  • filter_name: the name of the filter.

register_interfaces

def register_interfaces(self, config)

Register a set of interfaces defined in a file.

Call is only valid in startup mode

Parameters

  • configString: the location of the file or config String to load to generate the interfaces

request_next_step

def request_next_step(self) -> HelicsTime

Request a time advancement to the next allowed time.

Returns: The granted time step.


request_time

def request_time(self, time: HelicsTime) -> HelicsTime

Parameters

  • time: the next requested time step.

Returns: The granted time step.


request_time_advance

def request_time_advance(self, time_delta: HelicsTime) -> HelicsTime

Request a time advancement to the next allowed time.

Parameters

  • timeDelta: The amount of time requested to advance.

Returns: The granted time step.


request_time_async

def request_time_async(self, time: HelicsTime)

Request a time advancement and return immediately for asynchronous function. self.request_time_complete() should be called to finish the operation and get the result.

Parameters

  • time: the next requested time step

request_time_complete

def request_time_complete(self) -> HelicsTime

Request a time advancement.

Returns: the granted time step.


request_time_iterative

def request_time_iterative(self, time: float, iterate: HelicsIterationRequest) -> Tuple[HelicsTime, HelicsIterationResult]

Request a time advancement.

Parameters

  • time: the next requested time step.
  • iterate: a requested iteration mode.

Returns: The granted time step in a structure containing a return time and an iteration_result.


request_time_iterative_async

def request_time_iterative_async(self, time: float, iterate: HelicsIterationRequest)

Request a time advancement with iterative call and return for asynchronous function. self.request_time_iterative_complete() should be called to finish the operation and get the result.

Parameters

  • time: the next requested time step.
  • iterate: a requested iteration level (none, require, optional).

request_time_iterative_complete

def request_time_iterative_complete(self) -> Tuple[HelicsTime, HelicsIterationResult]

Finalize the time advancement request.

Returns: the granted time step and iteration result.


set_global

def set_global(self, name: str, value: str)

Set a federation global value.

This overwrites any previous value for this name.

Parameters

  • name: the name of the global to set.
  • value: the value of the global.

HelicsFederateFlag

class HelicsFederateFlag(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • OBSERVER = 0
  • UNINTERRUPTIBLE = 1
  • INTERRUPTIBLE = 2
  • SOURCE_ONLY = 4
  • ONLY_TRANSMIT_ON_CHANGE = 6
  • ONLY_UPDATE_ON_CHANGE = 8
  • WAIT_FOR_CURRENT_TIME_UPDATE = 10
  • RESTRICTIVE_TIME_POLICY = 11
  • REALTIME = 16
  • SLOW_RESPONDING = 29
  • DELAY_INIT_ENTRY = 45
  • ENABLE_INIT_ENTRY = 47
  • IGNORE_TIME_MISMATCH_WARNINGS = 67
  • TERMINATE_ON_ERROR = 72

Base classes

  • enum.IntEnum

HelicsFederateInfo

class HelicsFederateInfo(self, handle)

Initialize self. See help(type(self)) for accurate signature.


Base classes

  • helics.capi._HelicsCHandle

Instance attributes

  • broker

  • broker_init

  • broker_key

  • broker_port

  • core_init

  • core_name

  • core_type

  • local_port

  • separator


HelicsFederateState

class HelicsFederateState(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • STARTUP = 0
  • INITIALIZATION = 1
  • EXECUTION = 2
  • FINALIZE = 3
  • ERROR = 4
  • PENDING_INIT = 5
  • PENDING_EXEC = 6
  • PENDING_TIME = 7
  • PENDING_ITERATIVE_TIME = 8
  • PENDING_FINALIZE = 9

Base classes

  • enum.IntEnum

HelicsFilter

class HelicsFilter(self, handle)

Initialize self. See help(type(self)) for accurate signature.


Base classes

  • helics.capi._HelicsCHandle

Instance attributes

  • info Get the interface information field of the filter.

  • name


Methods

add_delivery_endpoint

def add_delivery_endpoint(self, delivery_endpoint: str)

Add a delivery destination from a filter.

Parameters

  • delivery_endpoint - A string with the delivery endpoint to add.

add_destination_target

def add_destination_target(self, destination: str)

Add a destination target to a cloning filter. All messages going to a destination are copied to the delivery address(es).


add_source_target

def add_source_target(self, source: str)

Add a source target to a cloning filter. All messages coming from a source are copied to the delivery address(es).


remove_delivery_endpoint

def remove_delivery_endpoint(self, delivery_endpoint: str)

Remove a delivery destination from a filter.

Parameters

  • delivery_endpoint - A string with the delivery endpoint to remove.

remove_destination_target

def remove_destination_target(self, destination: str)

remove a destination target from a cloning filter.


set

def set(self, property: str, value: float)

Set a property on a filter.


HelicsFilterType

class HelicsFilterType(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • CUSTOM = 0
  • DELAY = 1
  • RANDOM_DELAY = 2
  • RANDOM_DROP = 3
  • REROUTE = 4
  • CLONE = 5
  • FIREWALL = 6

Base classes

  • enum.IntEnum

HelicsHandleOption

class HelicsHandleOption(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • CONNECTION_REQUIRED = 397
  • CONNECTION_OPTIONAL = 402
  • SINGLE_CONNECTION_ONLY = 407
  • MULTIPLE_CONNECTIONS_ALLOWED = 409
  • BUFFER_DATA = 411
  • STRICT_TYPE_CHECKING = 414
  • IGNORE_UNIT_MISMATCH = 447
  • ONLY_TRANSMIT_ON_CHANGE = 452
  • ONLY_UPDATE_ON_CHANGE = 454
  • IGNORE_INTERRUPTS = 475
  • MULTI_INPUT_HANDLING_METHOD = 507
  • INPUT_PRIORITY_LOCATION = 510
  • CLEAR_PRIORITY_LIST = 512
  • CONNECTIONS = 522

Base classes

  • enum.IntEnum

HelicsInput

class HelicsInput(self, handle)

Initialize self. See help(type(self)) for accurate signature.


Base classes

  • helics.capi._HelicsCHandle

Instance attributes

  • boolean Get the value as a boolean.

  • bytes Get a raw value as a character vector.

  • complex Get the value as a complex number.

  • double Get the value as a double.

  • info Get the interface information field of the filter.

  • injection_units Get the units associated with an inputs publication.

  • integer Get the current value as a 64 bit integer.

  • key get the Name/Key for the input the name is the local name if given, key is the full key name.

  • name get the Name/Key for the input the name is the local name if given, key is the full key name.

  • named_point Get the current value as a named point.

  • publication_type Get the units associated with a publication of an input.

  • string Get the current value as a string.

  • target Get an associated target.

  • type Get the type of the input.

  • units Get the units associated with a input.

  • vector get the current value as a vector of doubles.


Methods

add_target

def add_target(self, target: str)

Add a publication target to the input.


clear_update

def clear_update(self)

Clear the updated flag.


get_last_update_time

def get_last_update_time(self) -> HelicsTime

Get the last time an input was updated.


is_updated

def is_updated(self) -> bool

Check if an input is updated.


is_valid

def is_valid(self) -> bool

Check if the input is valid.


set_default

def set_default(self, data: Union[bytes, str, int, bool, float, complex, List[float]])

Set the default value as a raw data Set the default value as a string Set the default value as an integer Set the default value as a bool Set the default value as a double Set the default value as a vector of doubles


HelicsIterationRequest

class HelicsIterationRequest(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • NO_ITERATION = 0
  • FORCE_ITERATION = 1
  • ITERATE_IF_NEEDED = 2

Base classes

  • enum.IntEnum

HelicsIterationResult

class HelicsIterationResult(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • NEXT_STEP = 0
  • ERROR = 1
  • HALTED = 2
  • ITERATING = 3

Base classes

  • enum.IntEnum

HelicsLogLevel

class HelicsLogLevel(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • NO_PRINT = -1
  • ERROR = 0
  • WARNING = 1
  • SUMMARY = 2
  • CONNECTIONS = 3
  • INTERFACES = 4
  • TIMING = 5
  • DATA = 6
  • TRACE = 7

Base classes

  • enum.IntEnum

HelicsMessage

class HelicsMessage(self, handle)

Initialize self. See help(type(self)) for accurate signature.


Base classes

  • helics.capi._HelicsCHandle

Instance attributes

  • data

  • destination

  • message_id

  • original_dest

  • original_destination

  • original_source

  • raw_data

  • source

  • time


Methods

append

def append(self, data: bytes)

is_valid

def is_valid(self) -> bool

HelicsMessageFederate

class HelicsMessageFederate(self, handle)

Initialize self. See help(type(self)) for accurate signature.


Base classes


Instance attributes

  • core

  • current_time

  • n_endpoints

  • n_filters

  • n_inputs

  • n_pending_messages Returns the number of pending receives for all endpoints.

  • n_publications

  • name

  • separator

  • state


Methods

create_message

def create_message(self) -> HelicsMessage

Create a message object.


get_endpoint_by_index

def get_endpoint_by_index(self, index: int) -> HelicsEndpoint

Get an Endpoint from an index.

Parameters

  • index: the index of the endpoint to retrieve index is 0 based

Return an Endpoint


get_endpoint_by_name

def get_endpoint_by_name(self, name: str) -> HelicsEndpoint

Get an Endpoint from its name.

Parameters

  • name: the name of the endpoint to retrieve.

Returns: an Endpoint


get_message

def get_message(self) -> HelicsMessage

Get a packet for any endpoints in the federate.


has_message

def has_message(self) -> bool

Checks if federate has any messages.


register_endpoint

def register_endpoint(self, name: str, kind: str = "") -> HelicsEndpoint

Register an endpoint.

Call is only valid in startup mode

  • name: the name of the endpoint
  • kind: the defined type of the interface for endpoint checking if requested

Returns: an Endpoint Object


register_global_endpoint

def register_global_endpoint(self, name: str, kind: str = "") -> HelicsEndpoint

Register an endpoint directly without prepending the federate name.

  • name: the name of the endpoint
  • kind: the defined type of the interface for endpoint checking if requested

Returns: an Endpoint Object


HelicsMultiInputMode

class HelicsMultiInputMode(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • NO_OP = 0
  • VECTORIZE_OPERATION = 1
  • AND_OPERATION = 2
  • OR_OPERATION = 3
  • SUM_OPERATION = 4
  • DIFF_OPERATION = 5
  • MAX_OPERATION = 6
  • MIN_OPERATION = 7
  • AVERAGE_OPERATION = 8

Base classes

  • enum.IntEnum

HelicsProperty

class HelicsProperty(value, names=None, *, module=None, qualname=None, type=None, start=1)
  • TIME_DELTA = 137
  • TIME_PERIOD = 140
  • TIME_OFFSET = 141
  • TIME_RT_LAG = 143
  • TIME_RT_LEAD = 144
  • TIME_RT_TOLERANCE = 145
  • TIME_INPUT_DELAY = 148
  • TIME_OUTPUT_DELAY = 150
  • INT_MAX_ITERATIONS = 259
  • INT_LOG_LEVEL = 271
  • INT_FILE_LOG_LEVEL = 272
  • INT_CONSOLE_LOG_LEVEL = 274

Base classes

  • enum.IntEnum

HelicsPublication

class HelicsPublication(self, handle)

Initialize self. See help(type(self)) for accurate signature.


Base classes

  • helics.capi._HelicsCHandle

Instance attributes

  • info Get the interface information field of the publication.

  • key Get the key for the publication.

  • name Get the key for the publication.

  • type Get the type for the publication.

  • units Get the units of the publication.


Methods

is_valid

def is_valid(self) -> bool

Check if the publication is valid.


publish

def publish(self, data: Union[bytes, str, int, complex, float, List[float], Tuple[str, float], bool])

publish raw bytes publish a string publish an int value publish a double publish a complex number publish a vector of doubles publish a named point with a string and double publish a boolean value


HelicsQuery

class HelicsQuery(handle)

Base classes

  • helics.capi._HelicsCHandle

HelicsSequencingMode

class HelicsSequencingMode(value, names=None, *, module=None, qualname=None, type=None, start=1)

Enumeration of sequencing modes for queries fast is the default, meaning the query travels along priority channels and takes precedence of over existing messages; ordered means it follows normal priority patterns and will be ordered along with existing messages

  • FAST = 0
  • ORDERED = 1

Base classes

  • enum.IntEnum

HelicsValueFederate

class HelicsValueFederate(self, handle)

Initialize self. See help(type(self)) for accurate signature.


Base classes


Instance attributes

  • core

  • current_time

  • n_endpoints

  • n_filters

  • n_inputs

  • n_pending_messages Returns the number of pending receives for all endpoints.

  • n_publications Get the number of publications in this federate.

  • n_subscriptions Get the number of inputs in this federate.

  • name

  • separator

  • state


Methods

clear_updates

def clear_updates(self)

Clear all the update flags from all federate inputs.


get_publication_by_index

def get_publication_by_index(self, index: int) -> HelicsPublication

Get a publication by index.

Parameters

  • index: a 0 based index of the publication to retrieve

Returns: a Publication object


get_publication_by_name

def get_publication_by_name(self, name: str) -> HelicsPublication

Get publication by name.


get_subscription_by_index

def get_subscription_by_index(self, index: int) -> HelicsInput

Get a subscription by index.


get_subscription_by_name

def get_subscription_by_name(self, name: str) -> HelicsInput

Get an input by index.


publish_json

def publish_json(self, data: Union[dict, str])

Publish data contained in a JSON file.


register_from_publication_json

def register_from_publication_json(self, data: Union[dict, str]) -> HelicsPublication

Register publications from a JSON output file or string.

Generates interface based on the data contained in a JSON file or string.


register_global_input

def register_global_input(self, name: str, kind: Union[str, HelicsDataType], units: str = "") -> HelicsInput

Register an input.

Call is only valid in startup mode.

Parameters

  • name: the name of the input
  • kind: a string defining the type of the input
  • units: a string defining the units of the input [optional]

Returns: an input object for use as an identifier.


register_global_publication

def register_global_publication(self, name: str, kind: Union[str, HelicsDataType], units: str = "") -> HelicsPublication

Register a publication

Call is only valid in startup mode

Parameters

  • name: the name of the publication
  • kind: the type of the publication
  • units: a string defining the units of the publication [optional]

Returns: a publication object for use as an identifier


register_input

def register_input(self, name: str, kind: Union[str, HelicsDataType], units: str = "") -> HelicsInput

Register an input.

Call is only valid in startup mode.

Parameters

  • name: the name of the input
  • kind: the type of input to register
  • units: a string defining the units of the input [optional]

Returns: an input id object for use as an identifier


register_publication

def register_publication(self, name: str, kind: Union[str, HelicsDataType], units: str = "") -> HelicsPublication

Register a publication.

Call is only valid in startup mode.

Parameters

  • name: the name of the publication.
  • kind: the type of the publication.
  • units: a string defining the units of the publication [optional]

Returns: a publication id object for use as an identifier


register_subscription

def register_subscription(self, name: str, units: str = "") -> HelicsInput

Functions

cchar

def cchar(c: str) -> str

cdouble

def cdouble(d: float) -> float

cstring

def cstring(s: str) -> str

helicsAbort

def helicsAbort(error_code: int, message: str)

helicsBrokerAddDestinationFilterToEndpoint

def helicsBrokerAddDestinationFilterToEndpoint(broker: HelicsBroker, filter_name: str, endpoint_name: str)

Link a named filter to a destination endpoint.

Parameters

  • broker - The broker to generate the connection from.
  • filter - The name of the filter.
  • endpoint - The name of the endpoint to filter the data going to.

helicsBrokerAddSourceFilterToEndpoint

def helicsBrokerAddSourceFilterToEndpoint(broker: HelicsBroker, filter_name: str, endpoint_name: str)

Link a named filter to a source endpoint.

Parameters

  • broker - The broker to generate the connection from.
  • filter - The name of the filter.
  • endpoint - The name of the endpoint to filter the data from.

helicsBrokerClearTimeBarrier

def helicsBrokerClearTimeBarrier(broker: HelicsBroker)

helicsBrokerClone

def helicsBrokerClone(broker: HelicsBroker) -> HelicsBroker

Create a new reference to an existing broker. This will create a new broker object that references the existing broker it must be freed as well.

Parameters

  • broker - An existing helics.HelicsBroker.

Returns: helics.HelicsBroker.


def helicsBrokerDataLink(broker: HelicsBroker, source_name: str, target_name: str)

Link a named publication and named input using a broker.

Parameters

  • broker - The broker to generate the connection from.
  • source_name - The name of the publication.
  • target_name - The name of the target to send the publication data.

helicsBrokerDestroy

def helicsBrokerDestroy(broker: HelicsBroker)

Disconnect and free a broker.


helicsBrokerDisconnect

def helicsBrokerDisconnect(broker: HelicsBroker)

Disconnect a broker.

Parameters

  • broker - The broker to disconnect.

helicsBrokerFree

def helicsBrokerFree(broker: HelicsBroker)

Release the memory associated with a broker.


helicsBrokerGetAddress

def helicsBrokerGetAddress(broker: HelicsBroker) -> str

Get the network address associated with a broker.

Parameters

  • broker - The broker to query.

Returns: A string with the network address of the broker.


helicsBrokerGetIdentifier

def helicsBrokerGetIdentifier(broker: HelicsBroker) -> str

Get an identifier for the broker.

Parameters

  • broker - The broker to query.

Returns: A string containing the identifier for the broker.


helicsBrokerGlobalError

def helicsBrokerGlobalError(broker: HelicsBroker, error_code: int, error_string: str)

helicsBrokerIsConnected

def helicsBrokerIsConnected(broker: HelicsBroker) -> bool

Check if a broker is connected. A connected broker implies it is attached to cores or cores could reach out to communicate.

Returns: True if connected, False if not connected.


helicsBrokerIsValid

def helicsBrokerIsValid(broker: HelicsBroker) -> bool

Check if a broker object is a valid object.

Parameters

  • broker - The helics.HelicsBroker object to test.

Returns: True if valid, False if not valid.


helicsBrokerMakeConnections

def helicsBrokerMakeConnections(broker: HelicsBroker, file: str)

Load a file containing connection information.

Parameters

  • broker - The broker to generate the connections from.
  • file - A JSON or TOML file containing connection information.

helicsBrokerSendCommand

def helicsBrokerSendCommand(broker, target, command, err)

helicsBrokerSetGlobal

def helicsBrokerSetGlobal(broker: HelicsBroker, name: str, value: str)

Set a federation global value. This overwrites any previous value for this name.

Parameters

  • broker - The broker to set the global through.
  • name - The name of the global to set.
  • value - The value of the global.

helicsBrokerSetLogFile

def helicsBrokerSetLogFile(broker: HelicsBroker, log_file: str)

Set the log file on a broker.

Parameters

  • broker - The broker to set the log file for.
  • log_file - The name of the file to log to.

helicsBrokerSetTimeBarrier

def helicsBrokerSetTimeBarrier(broker: HelicsBroker, barrier_time: HelicsTime)

Set the broker time barrier

Parameters

  • broker: the helics.HelicsBroker
  • barrier_time: the barrier time

helicsBrokerWaitForDisconnect

def helicsBrokerWaitForDisconnect(broker: HelicsBroker, ms_to_wait: int) -> bool

Wait for the broker to disconnect.

Parameters

  • broker - The broker to wait for.
  • ms_to_wait - The time out in millisecond (<0 for infinite timeout).

helicsCleanupLibrary

def helicsCleanupLibrary()

Function to do some housekeeping work. This runs some cleanup routines and tries to close out any residual thread that haven’t been shutdown yet.


helicsCloseLibrary

def helicsCloseLibrary()

Call when done using the helics library. This function will ensure the threads are closed properly. If possible this should be the last call before exiting.


helicsCoreAddDestinationFilterToEndpoint

def helicsCoreAddDestinationFilterToEndpoint(core: HelicsCore, filter_name: str, endpoint_name: str)

Link a named filter to a destination endpoint.

Parameters

  • core - The core to generate the connection from.
  • filter - The name of the filter.
  • endpoint - The name of the endpoint to filter the data going to.

helicsCoreAddSourceFilterToEndpoint

def helicsCoreAddSourceFilterToEndpoint(core: HelicsCore, filter_name: str, endpoint_name: str)

Link a named filter to a source endpoint.

Parameters

  • core - The core to generate the connection from.
  • filter - The name of the filter.
  • endpoint - The name of the endpoint to filter the data from.

helicsCoreClone

def helicsCoreClone(core: HelicsCore) -> HelicsCore

Create a new reference to an existing core. This will create a new helics.HelicsCore that references the existing core. The new helics.HelicsCore must be freed as well.

Parameters

  • core - An existing helics.HelicsCore.

Returns: helics.HelicsCore.


helicsCoreConnect

def helicsCoreConnect(core: HelicsCore) -> bool

Connect a core to the federate based on current configuration.

Parameters

  • core - The core to connect.

Returns: True if core is connected successfully, else False.


def helicsCoreDataLink(core: HelicsCore, source_name: str, target_name: str)

Link a named publication and named input using a core.

Parameters

  • core - The core to generate the connection from.
  • source_name - The name of the publication.
  • target_name - The name of the target to send the publication data.

helicsCoreDestroy

def helicsCoreDestroy(core: HelicsCore)

Disconnect and free a core.


helicsCoreDisconnect

def helicsCoreDisconnect(core: HelicsCore)

Disconnect a core from the federation.

Parameters

  • core - The core to query.

helicsCoreFree

def helicsCoreFree(core: HelicsCore)

Release the memory associated with a core.


helicsCoreGetAddress

def helicsCoreGetAddress(core: HelicsCore) -> str

Get the network address associated with a core.

Parameters

  • core - The core to query.

Returns: A string with the network address of the broker.


helicsCoreGetIdentifier

def helicsCoreGetIdentifier(core: HelicsCore) -> str

Get an identifier for the core.

Parameters

  • core - The core to query.

Returns: A string with the identifier of the core.


helicsCoreGlobalError

def helicsCoreGlobalError(broker: HelicsBroker, error_code: int, error_string: str)

helicsCoreIsConnected

def helicsCoreIsConnected(core: HelicsCore) -> bool

Check if a core is connected. A connected core implies it is attached to federates or federates could be attached to it.

Returns: True if connected, False if not connected.


helicsCoreIsValid

def helicsCoreIsValid(core: HelicsCore) -> bool

Check if a helics.HelicsCore is a valid object.

Parameters

  • core - The helics.HelicsCore object to test.

Returns: True if valid, False if not valid.


helicsCoreMakeConnections

def helicsCoreMakeConnections(core: HelicsCore, file: str)

Load a file containing connection information.

Parameters

  • core - The core to generate the connections from.
  • file - A JSON or TOML file containing connection information.

helicsCoreRegisterCloningFilter

def helicsCoreRegisterCloningFilter(core: HelicsCore, name: str) -> HelicsFilter

Create a cloning Filter on the specified core. Cloning filters copy a message and send it to multiple locations, source and destination can be added through other functions.

Parameters

  • core - The core to register through.
  • name - The name of the filter (can be NULL).

Returns: helics.HelicsFilter.


helicsCoreRegisterFilter

def helicsCoreRegisterFilter(core: HelicsCore, type: HelicsFilterType, name: str) -> HelicsFilter

Create a source Filter on the specified core. Filters can be created through a federate or a core.handle, linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise equivalent behavior.

Parameters

  • core - The core to register through.
  • type - The type of filter to create helics.HelicsFilterType.
  • name - The name of the filter (can be NULL).

Returns: helics.HelicsFilter.


helicsCoreSendCommand

def helicsCoreSendCommand(core, target, command, err)

helicsCoreSetGlobal

def helicsCoreSetGlobal(core: HelicsCore, name: str, value: str)

Set a global value in a core. This overwrites any previous value for this name.

Parameters

  • core - The core to set the global through.
  • name - The name of the global to set.
  • value - The value of the global.

helicsCoreSetLogFile

def helicsCoreSetLogFile(core: HelicsCore, log_file: str)

Set the log file on a core.

Parameters

  • core - The core to set the log file for.
  • log_file - The name of the file to log to.

helicsCoreSetReadyToInit

def helicsCoreSetReadyToInit(core: HelicsCore)

Set the core to ready for init. This function is used for cores that have filters but no federates so there needs to be a direct signal to the core to trigger the federation initialization.

Parameters

  • core - The helics.HelicsCore to enable init values for.

helicsCoreWaitForDisconnect

def helicsCoreWaitForDisconnect(core: HelicsCore, ms_to_wait: int) -> bool

Wait for the core to disconnect.

Parameters

  • core - The core to wait for.
  • ms_to_wait - The time out in millisecond (<0 for infinite timeout).

helicsCreateBroker

def helicsCreateBroker(type: str, name: str = "", init_string: str = "") -> HelicsBroker

Create a broker object

Parameters

  • type - The type of the broker to create.
  • name - The name of the broker. It can be a nullptr or empty string to have a name automatically assigned.
  • init_string - An initialization string to send to the core-the format is similar to command line arguments. Typical options include a broker address such as –broker=”XSSAF” if this is a subbroker, or the number of federates, or the address.

Returns: helics.HelicsBroker.


helicsCreateBrokerFromArgs

def helicsCreateBrokerFromArgs(type: str, name: str, arguments: List[str]) -> HelicsBroker

Create a helics.HelicsCore by passing command line arguments.

Parameters

  • type - The type of the core to create.
  • name - The name of the core. It can be a nullptr or empty string to have a name automatically assigned.
  • arguments - The list of string values from a command line.

Returns: helics.HelicsBroker.


helicsCreateCombinationFederate

def helicsCreateCombinationFederate(fed_name: str, fi: HelicsFederateInfo = None) -> HelicsCombinationFederate

Create a combination federate from helics.HelicsFederateInfo. Combination federates are both value federates and message federates, objects can be used in all functions that take a helics.HelicsFederate object as an argument.

Parameters

  • fed_name - A string with the name of the federate, can be NULL or an empty string to pull the default name from fi.
  • fi - The federate info object that contains details on the federate.

Returns: helics.HelicsCombinationFederate.


helicsCreateCombinationFederateFromConfig

def helicsCreateCombinationFederateFromConfig(config_file: str) -> HelicsCombinationFederate

Create a combination federate from a JSON file or JSON string or TOML file. Combination federates are both value federates and message federates, objects can be used in all functions that take a helics.HelicsFederate object as an argument.

Parameters

  • config_file - A JSON file or a JSON string or TOML file that contains setup and configuration information.

Returns: helics.HelicsCombinationFederate.


helicsCreateCore

def helicsCreateCore(type: str, name: str, init_string: str) -> HelicsCore

Create a helics.HelicsCore.

Parameters

  • type - The type of the core to create.
  • name - The name of the core. It can be a nullptr or empty string to have a name automatically assigned.
  • init_string - An initialization string to send to the core. The format is similar to command line arguments. Typical options include a broker name, the broker address, the number of federates, etc.

Returns: helics.HelicsCore.


helicsCreateCoreFromArgs

def helicsCreateCoreFromArgs(type: str, name: str, arguments: List[str]) -> HelicsCore

Create a helics.HelicsCore by passing command line arguments.

Parameters

  • type - The type of the core to create.
  • name - The name of the core. It can be a nullptr or empty string to have a name automatically assigned.
  • arguments - The list of string values from a command line.

Returns: helics.HelicsCore.


helicsCreateFederateInfo

def helicsCreateFederateInfo() -> HelicsFederateInfo

Create helics.HelicsFederateInfo for specifying federate information when constructing a federate.

Returns: helics.HelicsFederateInfo.


helicsCreateMessageFederate

def helicsCreateMessageFederate(fed_name: str, fi: HelicsFederateInfo = None) -> HelicsMessageFederate

Create helics.HelicsMessageFederate from helics.HelicsFederateInfo. helics.HelicsMessageFederate objects can be used in all functions that take a helics.HelicsFederate as an argument.

Parameters

  • fed_name - The name of the federate to create.
  • fi - The federate info object that contains details on the federate.

Returns: helics.HelicsMessageFederate.


helicsCreateMessageFederateFromConfig

def helicsCreateMessageFederateFromConfig(config_file: str) -> HelicsMessageFederate

Create helics.HelicsMessageFederate from a JSON file or JSON string or TOML file. helics.HelicsMessageFederate objects can be used in all functions that take a helics.HelicsFederate object as an argument.

Parameters

  • config_file - A config (JSON,TOML) file or a JSON string that contains setup and configuration information.

Returns: helics.HelicsMessageFederate.


helicsCreateQuery

def helicsCreateQuery(target_name: str, query_string: str) -> HelicsQuery

Create a query object. A query object consists of a target and query string.

Parameters

  • target_name - The name of the target to query.
  • query_string - The query to make of the target.

Returns: helics.HelicsQuery.


helicsCreateValueFederate

def helicsCreateValueFederate(fed_name: str, fi: HelicsFederateInfo = None) -> HelicsValueFederate

Creation and destruction of Federates. Create helics.HelicsValueFederate from helics.HelicsFederateInfo. helics.HelicsValueFederate objects can be used in all functions that take a helics.HelicsFederate as an argument.

Parameters

  • fed_name - The name of the federate to create, can NULL or an empty string to use the default name from fi or an assigned name.
  • fi - The federate info object that contains details on the federate.

Returns: helics.HelicsValueFederate.


helicsCreateValueFederateFromConfig

def helicsCreateValueFederateFromConfig(config_file: str) -> HelicsValueFederate

Create helics.HelicsValueFederate from a JSON file, JSON string, or TOML file. helics.HelicsValueFederate objects can be used in all functions that take a helics.HelicsFederate as an argument.

Parameters

  • config_file - A JSON file or a JSON string or TOML file that contains setup and configuration information.

Returns: helics.HelicsValueFederate.


helicsEndpointAddDestinationFilter

def helicsEndpointAddDestinationFilter(endpoint: HelicsEndpoint, filter_name: str)

Add destination filter to endpoint

Parameters

  • endpoint - The endpoint.
  • filter_name - The name of the filter.

helicsEndpointAddDestinationTarget

def helicsEndpointAddDestinationTarget(endpoint: HelicsEndpoint, destination_name: str)

Add a destination target to a endpoint. All messages coming from a source are copied to the delivery address(es).

Parameters

  • endpoint - The given endpoint.
  • source_name - The name of the endpoint to add as a source target.

helicsEndpointAddSourceFilter

def helicsEndpointAddSourceFilter(endpoint: HelicsEndpoint, filter_name: str)

Add source filter to endpoint

Parameters

  • endpoint - The endpoint.
  • filter_name - The name of the filter.

helicsEndpointAddSourceTarget

def helicsEndpointAddSourceTarget(endpoint: HelicsEndpoint, source_name: str)

Add a source target to a endpoint. All messages coming from a source are copied to the delivery address(es).

Parameters

  • endpoint - The given endpoint.
  • source_name - The name of the endpoint to add as a source target.

helicsEndpointClearMessages

def helicsEndpointClearMessages(endpoint: HelicsEndpoint)

Clear all message from an endpoint.

_**Deprecated: Use helics.helicsFederateClearMessages to free all messages, or helics.helicsMessageFree to clear an individual message.

Parameters

  • endpoint - The endpoint object to operate on.

DEPRECATED


helicsEndpointCreateMessage

def helicsEndpointCreateMessage(endpoint: HelicsEndpoint) -> HelicsMessage

Create a new empty message object. The message is empty and isValid will return false since there is no data associated with the message yet.

Parameters

  • endpoint - The endpoint object to associate the message with.

helicsEndpointCreateMessageObject

def helicsEndpointCreateMessageObject(endpoint: HelicsEndpoint) -> HelicsMessage

Create a new empty message. The message is empty and isValid will return false since there is no data associated with the message yet.

Parameters

  • endpoint - The endpoint object to associate the message with.

DEPRECATED


helicsEndpointGetDefaultDestination

def helicsEndpointGetDefaultDestination(endpoint: HelicsEndpoint) -> str

Get the default destination for an endpoint.

Parameters

  • endpoint - The endpoint to set the destination for.

Returns: A string with the default destination.


helicsEndpointGetInfo

def helicsEndpointGetInfo(endpoint: HelicsEndpoint) -> str

Get the data in the info field of a filter.

Parameters

  • end - The filter to query.

Returns: A string with the info field string.


helicsEndpointGetMessage

def helicsEndpointGetMessage(endpoint: HelicsEndpoint) -> HelicsMessage

Receive a packet from a particular endpoint.

Parameters

  • endpoint - The identifier for the endpoint.

Returns: A message object.


helicsEndpointGetMessageObject

def helicsEndpointGetMessageObject(endpoint: HelicsEndpoint) -> HelicsMessage

Receive a packet from a particular endpoint.

Parameters

  • endpoint - The identifier for the endpoint.

Returns: A message.

DEPRECATED


helicsEndpointGetName

def helicsEndpointGetName(endpoint: HelicsEndpoint) -> str

Get the name of an endpoint.

Parameters

  • endpoint - The endpoint object in question.

Returns: The name of the endpoint.


helicsEndpointGetOption

def helicsEndpointGetOption(endpoint: HelicsEndpoint, option: HelicsHandleOption) -> int

Get the value of handle option on an endpoint.

Parameters

  • endpoint - The endpoint to modify.
  • option - Integer code for the option to set helics.HelicsHandleOption.

Returns: the value of the option, for boolean options will be 0 or 1.


helicsEndpointGetType

def helicsEndpointGetType(endpoint: HelicsEndpoint) -> str

Get the type specified for an endpoint.

Parameters

  • endpoint - The endpoint object in question.

Returns: The defined type of the endpoint.


helicsEndpointHasMessage

def helicsEndpointHasMessage(endpoint: HelicsEndpoint) -> bool

Check if a given endpoint has any unread messages.

Parameters

  • endpoint - The endpoint to check.

Returns: True if the endpoint has a message, False otherwise.


helicsEndpointIsValid

def helicsEndpointIsValid(endpoint: HelicsEndpoint) -> bool

Check if an endpoint is valid.

Parameters

  • endpoint - The endpoint object to check.

Returns: True if the Endpoint object represents a valid endpoint.


helicsEndpointPendingMessages

def helicsEndpointPendingMessages(endpoint: HelicsEndpoint) -> int

Returns the number of pending receives for all endpoints of a particular federate.

Parameters

  • endpoint - The endpoint to query.

helicsEndpointPendingMessagesCount

def helicsEndpointPendingMessagesCount(endpoint: HelicsEndpoint) -> int

Returns the number of pending receives for all endpoints of a particular federate.

Parameters

  • endpoint - The endpoint to query.

helicsEndpointRemoveTarget

def helicsEndpointRemoveTarget(endpoint: HelicsEndpoint, target: str)

Remove target from endpoint

Parameters

  • endpoint - The given endpoint.
  • target_name - The name of the endpoint to remove.

helicsEndpointSendBytesTo

def helicsEndpointSendBytesTo(endpoint: HelicsEndpoint, data: bytes, destination: str)

Send a message to the specified destination.

Parameters

  • endpoint - The endpoint to send the data from.
  • data - The data to send.
  • destination - The target destination.

helicsEndpointSendBytesToAt

def helicsEndpointSendBytesToAt(endpoint: HelicsEndpoint, data: bytes, destination: str, time: HelicsTime)

Send a message at a specific time to the specified destination.

Parameters

  • endpoint - The endpoint to send the data from.
  • data - The data to send.
  • destination - The target destination.
  • time - The time the message should be sent.

helicsEndpointSendEventRaw

def helicsEndpointSendEventRaw(
    endpoint: HelicsEndpoint, destination: str, data: bytes, time: HelicsTime,
)

Send a message at a specific time to the specified destination.

Parameters

  • endpoint - The endpoint to send the data from.
  • destination - The target destination.
  • data - The data to send.
  • time - The time the message should be sent.

DEPRECATED

Use helicsEndpointSendBytesToAt instead.


helicsEndpointSendMessage

def helicsEndpointSendMessage(endpoint: HelicsEndpoint, message: HelicsMessage)

Send a message object from a specific endpoint.

Parameters

  • endpoint - The endpoint to send the data from.
  • message - The actual message to send which will be copied.

helicsEndpointSendMessageObject

def helicsEndpointSendMessageObject(endpoint: HelicsEndpoint, message: HelicsMessage)

Send a message object from a specific endpoint.

Parameters

  • endpoint - The endpoint to send the data from.
  • message - The actual message to send which will be copied.

DEPRECATED


helicsEndpointSendMessageObjectZeroCopy

def helicsEndpointSendMessageObjectZeroCopy(endpoint: HelicsEndpoint, message: HelicsMessage)

Send a message object from a specific endpoint.

Parameters

  • endpoint - The endpoint to send the data from.
  • message - The actual message to send which will be copied.

DEPRECATED


helicsEndpointSendMessageRaw

def helicsEndpointSendMessageRaw(endpoint: HelicsEndpoint, destination: str, data: bytes)

Send a message to the specified destination.

Parameters

  • endpoint - The endpoint to send the data from.
  • destination - The target destination.
  • data - The data to send.

DEPRECATED

Use helicsEndpointSendBytesTo instead


helicsEndpointSetDefaultDestination

def helicsEndpointSetDefaultDestination(endpoint: HelicsEndpoint, destination: str)

Set the default destination for an endpoint if no other endpoint is given.

Parameters

  • endpoint - The endpoint to set the destination for.
  • destination - A string naming the desired default endpoint.

helicsEndpointSetInfo

def helicsEndpointSetInfo(endpoint: HelicsEndpoint, info: str)

Set the data in the info field for a filter.

Parameters

  • endpoint - The endpoint to query.
  • info - The string to set.

helicsEndpointSetOption

def helicsEndpointSetOption(endpoint: HelicsEndpoint, option: HelicsHandleOption, value: int)

Set a handle option on an endpoint.

Parameters

  • endpoint - The endpoint to modify.
  • option - Integer code for the option to set helics.HelicsHandleOption.
  • value - The value to set the option to.

helicsEndpointSubscribe

def helicsEndpointSubscribe(endpoint: HelicsEndpoint, name: str)

Subscribe an endpoint to a publication.

Parameters

  • endpoint - The endpoint to use.
  • name - The name of the publication.

helicsErrorClear

def helicsErrorClear(err: HelicsError)

Clear an error object.


helicsErrorInitialize

def helicsErrorInitialize() -> HelicsError

Return an initialized error object.


helicsFederateAddDependency

def helicsFederateAddDependency(fed: HelicsFederate, name: str)

Add a time dependency for a federate. The federate will depend on the given named federate for time synchronization.

Parameters

  • fed - The federate to add the dependency for.
  • name - The name of the federate to depend on.

helicsFederateClearMessages

def helicsFederateClearMessages(fed: HelicsFederate)

Clear all stored messages from a federate. This clears messages retrieved through helics.helicsFederateGetMessage or helics.helicsFederateGetMessageObject.

Parameters

  • fed - The federate to clear the message for.

helicsFederateClearUpdates

def helicsFederateClearUpdates(fed: HelicsFederate)

Clear all the update flags from a federates inputs.

Parameters

  • fed - The value helics.HelicsFederate for which to clear update flags.

helicsFederateClone

def helicsFederateClone(fed: HelicsFederate) -> HelicsFederate

Create a new reference to an existing federate. This will create a new helics.HelicsFederate object that references the existing federate. The new object must be freed as well.

Parameters

  • fed - An existing helics.HelicsFederate.

Returns: helics.HelicsFederate.


helicsFederateCreateMessage

def helicsFederateCreateMessage(fed: HelicsFederate) -> HelicsMessage

Create a new empty message object. The message is empty and isValid will return false since there is no data associated with the message yet.

Parameters

  • fed - the helics.HelicsFederate to associate the message with.

helicsFederateCreateMessageObject

def helicsFederateCreateMessageObject(fed: HelicsFederate) -> HelicsMessage

Create a new empty message object. The message is empty and isValid will return false since there is no data associated with the message yet.

Parameters

  • fed - the helics.HelicsFederate to associate the message with.

DEPRECATED


helicsFederateDestroy

def helicsFederateDestroy(fed: HelicsFederate)

Disconnect and free a federate.


helicsFederateDisconnect

def helicsFederateDisconnect(fed: HelicsFederate)

Disconnect the federate. This function halts all communication in the federate and disconnects it from the core.


helicsFederateDisconnectAsync

def helicsFederateDisconnectAsync(fed: HelicsFederate)

Disconnect the federate in an async call.


helicsFederateDisconnectComplete

def helicsFederateDisconnectComplete(fed: HelicsFederate)

Complete the asynchronous disconnect call.


helicsFederateEnterExecutingMode

def helicsFederateEnterExecutingMode(fed: HelicsFederate)

Request that the federate enter the Execution mode. This call is blocking until granted entry by the helics.HelicsCore. On return from this call the federate will be at time 0. For an asynchronous alternative call see helics.helicsFederateEnterExecutingModeAsync

Parameters

  • fed - A federate to change modes.

helicsFederateEnterExecutingModeAsync

def helicsFederateEnterExecutingModeAsync(fed: HelicsFederate)

Request that the federate enter the Execution mode. This call is non-blocking and will return immediately. Call helics.helicsFederateEnterExecutingModeComplete to finish the call sequence

Parameters

  • fed - The helics.HelicsFederate to complete the call.

helicsFederateEnterExecutingModeComplete

def helicsFederateEnterExecutingModeComplete(fed: HelicsFederate)

Complete the call to helics.helicsFederateEnterExecutingModeAsync.

Parameters

  • fed - The helics.HelicsFederate to complete the call.

helicsFederateEnterExecutingModeIterative

def helicsFederateEnterExecutingModeIterative(fed: HelicsFederate, iterate: HelicsIterationRequest) -> HelicsIterationResult

Request an iterative time. This call allows for finer grain control of the iterative process than helics.helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status.

Parameters

  • fed - The federate to make the request of.
  • iterate - helics.HelicsIterationRequest, i.e. the requested iteration mode.

Returns: helics.HelicsIterationResult.


helicsFederateEnterExecutingModeIterativeAsync

def helicsFederateEnterExecutingModeIterativeAsync(fed: HelicsFederate, iterate: HelicsIterationRequest)

Request an iterative entry to the execution mode. This call allows for finer grain control of the iterative process than helics.helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status.

Parameters

  • fed - The federate to make the request of.
  • iterate - helics.HelicsIterationRequest, i.e. the requested iteration mode.

helicsFederateEnterExecutingModeIterativeComplete

def helicsFederateEnterExecutingModeIterativeComplete(fed: HelicsFederate,) -> HelicsIterationResult

Complete the asynchronous iterative call into ExecutionMode.

Parameters

  • fed - The federate to make the request of.

Returns: helics.HelicsIterationResult.


helicsFederateEnterInitializingMode

def helicsFederateEnterInitializingMode(fed: HelicsFederate)

Initialization, execution, and time requests. Enter the initialization state of a federate. The initialization state allows initial values to be set and received if the iteration is requested on entry to the execution state. This is a blocking call and will block until the core allows it to proceed.

Parameters

  • fed - The federate to operate on.

helicsFederateEnterInitializingModeAsync

def helicsFederateEnterInitializingModeAsync(fed: HelicsFederate)

Non blocking alternative to helics.helicsFederateEnterInitializingMode. The function helicsFederateEnterInitializationModeFinalize must be called to finish the operation.

Parameters

  • fed - The federate to operate on.

helicsFederateEnterInitializingModeComplete

def helicsFederateEnterInitializingModeComplete(fed: HelicsFederate)

Finalize the entry to initialize mode that was initiated with helics.helicsEnterInitializingModeAsync.

Parameters

  • fed - The federate desiring to complete the initialization step.

helicsFederateFinalize

def helicsFederateFinalize(fed: HelicsFederate)

Finalize the federate. This function halts all communication in the federate and disconnects it from the core.


helicsFederateFinalizeAsync

def helicsFederateFinalizeAsync(fed: HelicsFederate)

Finalize the federate in an async call.


helicsFederateFinalizeComplete

def helicsFederateFinalizeComplete(fed: HelicsFederate)

Complete the asynchronous disconnect call.


helicsFederateFree

def helicsFederateFree(fed: HelicsFederate)

Release the memory associated with a federate.


helicsFederateGetCommand

def helicsFederateGetCommand(fed: HelicsFederate) -> str

helicsFederateGetCommandSource

def helicsFederateGetCommandSource(fed: HelicsFederate) -> str

helicsFederateGetCore

def helicsFederateGetCore(fed: HelicsFederate) -> HelicsCore

Get the helics.HelicsCore associated with a federate.

Parameters

  • fed - helics.HelicsFederate.

Returns: helics.HelicsCore.


helicsFederateGetCoreObject

def helicsFederateGetCoreObject(fed: HelicsFederate) -> HelicsCore

Get the helics.HelicsCore associated with a federate.

Parameters

  • fed - helics.HelicsFederate.

Returns: helics.HelicsCore.


helicsFederateGetCurrentTime

def helicsFederateGetCurrentTime(fed: HelicsFederate) -> HelicsTime

Get the current time of the federate.

Parameters

  • fed - The helics.HelicsFederate to query.

Returns: helics.HelicsTime.


helicsFederateGetEndpoint

def helicsFederateGetEndpoint(fed: HelicsFederate, name: str) -> HelicsEndpoint

Get an endpoint object from a name.

Parameters

  • fed - The message helics.HelicsFederate to use to get the endpoint.
  • name - The name of the endpoint.

Returns: helics.HelicsEndpoint.


helicsFederateGetEndpointByIndex

def helicsFederateGetEndpointByIndex(fed: HelicsFederate, index: int) -> HelicsEndpoint

Get an endpoint by its index, typically already created via registerInterfaces file or something of that nature.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • index - The index of the publication to get.

Returns: helics.HelicsEndpoint.


helicsFederateGetEndpointCount

def helicsFederateGetEndpointCount(fed: HelicsFederate) -> int

Get the number of endpoints in a federate.

Parameters

  • fed - The message federate to query.

Returns: (-1) if fed was not a valid federate, otherwise returns the number of endpoints.


helicsFederateGetFilter

def helicsFederateGetFilter(fed: HelicsFederate, name: str) -> HelicsFilter

Get a filter by its name, typically already created via registerInterfaces file or something of that nature.

Parameters

  • fed - The helics.HelicsFederate to use to get the filter.
  • name - The name of the filter.

Returns: helics.HelicsFilter.


helicsFederateGetFilterByIndex

def helicsFederateGetFilterByIndex(fed: HelicsFederate, index: int) -> HelicsFilter

Get a filter by its index, typically already created via registerInterfaces file or something of that nature.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • index - The index of the publication to get.

Returns: helics.HelicsFilter.


helicsFederateGetFilterCount

def helicsFederateGetFilterCount(fed: HelicsFederate) -> int

Get the number of filters registered through a federate.

Parameters

  • fed - The helics.HelicsFederate to use to get the filter.

Returns: A count of the number of filters registered through a federate.


helicsFederateGetFlagOption

def helicsFederateGetFlagOption(fed: HelicsFederate, flag: HelicsFederateFlag) -> bool

Get a flag value for a federate.

Parameters

  • fed - The federate to get the flag for.
  • flag - The helics.HelicsFederateFlag to query.

helicsFederateGetInput

def helicsFederateGetInput(fed: HelicsFederate, name: str) -> HelicsInput

Get an input object from a name.

Parameters

  • fed - The value helics.HelicsFederate to use to get the publication.
  • name - The name of the input.

Returns: helics.HelicsInput.


helicsFederateGetInputByIndex

def helicsFederateGetInputByIndex(fed: HelicsFederate, index: int) -> HelicsInput

Get an input by its index, typically already created via registerInterfaces file or something of that nature.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • index - The index of the publication to get.

Returns: helics.HelicsInput


helicsFederateGetInputCount

def helicsFederateGetInputCount(fed: HelicsFederate) -> int

Get the number of subscriptions in a federate.

Returns: (-1) if fed was not a valid federate otherwise returns the number of subscriptions.


helicsFederateGetIntegerProperty

def helicsFederateGetIntegerProperty(fed: HelicsFederate, property: HelicsProperty) -> int

Get the current value of an integer property (such as a logging level).

Parameters

  • fed - The federate to get the flag for.
  • property - A code for the property to set helics.HelicsProperty.

helicsFederateGetMessage

def helicsFederateGetMessage(fed: HelicsFederate) -> HelicsMessage

Receive a communication message for any endpoint in the federate. The return order will be in order of endpoint creation. So all messages that are available for the first endpoint.handle, then all for the second, and so on. Within a single endpoint.handle, the messages are ordered by time, then source_id, then order of arrival.

Returns: A helics.HelicsMessage which references the data in the message.


helicsFederateGetMessageObject

def helicsFederateGetMessageObject(fed: HelicsFederate) -> HelicsMessage

Receive a communication message for any endpoint in the federate. The return order will be in order of endpoint creation. So all messages that are available for the first endpoint.handle, then all for the second, and so on. Within a single endpoint.handle, the messages are ordered by time, then source_id, then order of arrival.

Returns: A helics.HelicsMessage which references the data in the message.

DEPRECATED


helicsFederateGetName

def helicsFederateGetName(fed: HelicsFederate) -> str

Get the name of the federate.

Parameters

  • fed - The helics.HelicsFederate to query.

Returns: A string with the name.


helicsFederateGetPublication

def helicsFederateGetPublication(fed: HelicsFederate, name: str) -> HelicsPublication

Get a helics.HelicsPublication from a name.

Parameters

  • fed - The value helics.HelicsFederate to use to get the publication.
  • name - The name of the publication.

Returns: helics.HelicsPublication.


helicsFederateGetPublicationByIndex

def helicsFederateGetPublicationByIndex(fed: HelicsFederate, index: int) -> HelicsPublication

Get a publication by its index, typically already created via registerInterfaces file or something of that nature.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • index - The index of the publication to get.

Returns: helics.HelicsPublication.


helicsFederateGetPublicationCount

def helicsFederateGetPublicationCount(fed: HelicsFederate) -> int

Get the number of publications in a federate.

Returns: (-1) if fed was not a valid federate otherwise returns the number of publications.


helicsFederateGetState

def helicsFederateGetState(fed: HelicsFederate) -> HelicsFederateState

Get the current state of a federate.

Parameters

  • fed - The federate to query.

Returns: helics.HelicsFederateState.


helicsFederateGetSubscription

def helicsFederateGetSubscription(fed: HelicsFederate, name: str) -> HelicsInput

Get an input object from a subscription target.

Parameters

  • fed - The value helics.HelicsFederate to use to get the publication.
  • name - The name of the publication that a subscription is targeting.

Returns: helics.HelicsInput


helicsFederateGetTimeProperty

def helicsFederateGetTimeProperty(fed: HelicsFederate, time_property: int) -> HelicsTime

Get the current value of a time based property in a federate.

Parameters

  • fed - The federate query.
  • time_property - The property to query.

Returns: helics.HelicsTime.


helicsFederateGlobalError

def helicsFederateGlobalError(fed: HelicsFederate, error_code: int, error_string: str)

Generate a global error from a federate. A global error halts the co-simulation completely.

Parameters

  • fed - The federate to create an error in.
  • error_code - The integer code for the error.
  • error_string - A string describing the error.

helicsFederateHasMessage

def helicsFederateHasMessage(fed: HelicsFederate) -> bool

Check if the federate has any outstanding messages.

Parameters

  • fed - The federate to check.

Returns: True if the federate has a message waiting, False otherwise.


helicsFederateInfoClone

def helicsFederateInfoClone(fi: HelicsFederateInfo) -> HelicsFederateInfo

Create helics.HelicsFederateInfo from an existing one and clone the information.

Parameters

  • fi - A federateInfo object to duplicate.

Returns: helics.HelicsFederateInfo.


helicsFederateInfoFree

def helicsFederateInfoFree(fi: HelicsFederateInfo)

Delete the memory associated with helics.HelicsFederateInfo.


helicsFederateInfoLoadFromArgs

def helicsFederateInfoLoadFromArgs(fi: HelicsFederateInfo, arguments: List[str])

Load federate info from command line arguments.

Parameters

  • fi - A federateInfo object.
  • argc - The number of command line arguments.
  • argv - An array of strings from the command line.

helicsFederateInfoSetBroker

def helicsFederateInfoSetBroker(fi: HelicsFederateInfo, broker_string: str)

Set the name or connection information for a broker. This is only used if the core is automatically created, the broker information will be transferred to the core for connection.

Parameters

  • fi - The federate info object to alter.
  • broker_string - A string which defines the connection information for a broker either a name or an address.

helicsFederateInfoSetBrokerInitString

def helicsFederateInfoSetBrokerInitString(fi: HelicsFederateInfo, broker_init_string: str)

Set the initialization string that a core will pass to a generated broker usually in the form of command line arguments.

Parameters

  • fi - The federate info object to alter.
  • broker_init_string - A string with command line arguments for a generated broker.

helicsFederateInfoSetBrokerKey

def helicsFederateInfoSetBrokerKey(fi: HelicsFederateInfo, broker_key: str)

Set the key for a broker connection. This is only used if the core is automatically created, the broker information will be transferred to the core for connection.

Parameters

  • fi - The federate info object to alter.
  • broker_key - A string containing a key for the broker to connect.

helicsFederateInfoSetBrokerPort

def helicsFederateInfoSetBrokerPort(fi: HelicsFederateInfo, broker_port: Union[int, str])

Set the port to use for the broker. This is only used if the core is automatically created, the broker information will be transferred to the core for connection. This will only be useful for network broker connections.

Parameters

  • fi - The federate info object to alter.
  • broker_port - The integer port number to use for connection with a broker.

helicsFederateInfoSetCoreInitString

def helicsFederateInfoSetCoreInitString(fi: HelicsFederateInfo, core_init_string: str)

Set the initialization string for the core usually in the form of command line arguments.

Parameters

  • fi - The federate info object to alter.
  • core_init_string - A string containing command line arguments to be passed to the core.

helicsFederateInfoSetCoreName

def helicsFederateInfoSetCoreName(fi: HelicsFederateInfo, core_name: str)

Set the name of the core to link to for a federate.

Parameters

  • fi - The federate info object to alter.
  • core_name - The identifier for a core to link to.

helicsFederateInfoSetCoreType

def helicsFederateInfoSetCoreType(fi: HelicsFederateInfo, core_type: HelicsCoreType)

Set the core type by integer code. Valid values available by definitions in api-data.h.

Parameters

  • fi - The federate info object to alter.
  • core_type - An numerical code for a core type see helics.HelicsCoreType.

helicsFederateInfoSetCoreTypeFromString

def helicsFederateInfoSetCoreTypeFromString(fi: HelicsFederateInfo, core_type: str)

Set the core type from a string.

Parameters

  • fi - The federate info object to alter.
  • core_type - A string naming a core type.

helicsFederateInfoSetFlagOption

def helicsFederateInfoSetFlagOption(fi: HelicsFederateInfo, flag: HelicsFederateFlag, value: bool)

Set a flag in the info structure Valid flags are available helics.HelicsFederateFlag.

Parameters

  • fi - The federate info object to alter.
  • flag - A numerical index for a flag.
  • value - The desired value of the flag True or False.

helicsFederateInfoSetIntegerProperty

def helicsFederateInfoSetIntegerProperty(fi: HelicsFederateInfo, property: HelicsProperty, value: int)

Set an integer property for a federate. Set known properties.

Parameters

  • fi - The federateInfo object to alter.
  • property - helics.HelicsProperty.
  • value - The value to set the property to.

helicsFederateInfoSetLocalPort

def helicsFederateInfoSetLocalPort(fi: HelicsFederateInfo, local_port: Union[int, str])

Set the local port to use. This is only used if the core is automatically created, the port information will be transferred to the core for connection.

Parameters

  • fi - The federate info object to alter.
  • local_port - A string with the port information to use as the local server port can be a number or “auto” or “os_local”.

helicsFederateInfoSetSeparator

def helicsFederateInfoSetSeparator(fi: HelicsFederateInfo, separator: str)

Set the separator character in the info structure. The separator character is the separation character for local publications/endpoints in creating their global name. For example if the separator character is ‘/’ then a local endpoint would have a globally reachable name of fedName/localName.

Parameters

  • fi - The federate info object to alter.
  • separator - The character to use as a separator.

helicsFederateInfoSetTimeProperty

def helicsFederateInfoSetTimeProperty(fi: HelicsFederateInfo, time_property: HelicsProperty, value: HelicsTime)

Set the output delay for a federate.

Parameters

  • fi - The federate info object to alter.
  • time_property - An integer representation of the time based property to set see helics.HelicsProperty.
  • propertyValue - The value of the property to set the timeProperty to.

helicsFederateIsAsyncOperationCompleted

def helicsFederateIsAsyncOperationCompleted(fed: HelicsFederate) -> bool

Check if the current Asynchronous operation has completed.

Parameters

  • fed - The federate to operate on.

Returns: True if current operation has completed, else False.


helicsFederateIsValid

def helicsFederateIsValid(fed: HelicsFederate) -> bool

Check if a helics.HelicsFederate is valid.

Returns: True if the federate is a valid active federate, False otherwise.


helicsFederateLocalError

def helicsFederateLocalError(fed: HelicsFederate, error_code: int, error_string: str)

Generate a local error in a federate. This will propagate through the co-simulation but not necessarily halt the co-simulation, it has a similar effect to finalize but does allow some interaction with a core for a brief time.

Parameters

  • fed - The federate to create an error in.
  • error_code - The integer code for the error.
  • error_string - A string describing the error.

helicsFederateLogDebugMessage

def helicsFederateLogDebugMessage(fed: HelicsFederate, log_message: str)

Log a debug message through a federate.

Parameters

  • fed - The federate to log the debug message through.
  • log_message - The message to put in the log.

helicsFederateLogErrorMessage

def helicsFederateLogErrorMessage(fed: HelicsFederate, log_message: str)

Log an error message through a federate.

Parameters

  • fed - The federate to log the error message through.
  • log_message - The message to put in the log.

helicsFederateLogInfoMessage

def helicsFederateLogInfoMessage(fed: HelicsFederate, log_message: str)

Log an info message through a federate.

Parameters

  • fed - The federate to log the info message through.
  • log_message - The message to put in the log.

helicsFederateLogLevelMessage

def helicsFederateLogLevelMessage(fed: HelicsFederate, log_level: HelicsLogLevel, log_message: str)

Log a message through a federate.

Parameters

  • fed - The federate to log the message through.
  • log_level - The level of the message to log see helics.HelicsLogLevel.
  • log_message - The message to put in the log.

helicsFederateLogWarningMessage

def helicsFederateLogWarningMessage(fed: HelicsFederate, log_message: str)

Log a warning message through a federate.

Parameters

  • fed - The federate to log the warning message through.
  • log_message - The message to put in the log.

helicsFederatePendingMessages

def helicsFederatePendingMessages(fed: HelicsFederate) -> int

Returns the number of pending receives for the specified destination endpoint.

Parameters

  • fed - The federate to get the number of waiting messages from.

DEPRECATED


helicsFederatePendingMessagesCount

def helicsFederatePendingMessagesCount(fed: HelicsFederate) -> int

Returns the number of pending receives for the specified destination endpoint.

Parameters

  • fed - The federate to get the number of waiting messages from.

helicsFederatePublishJSON

def helicsFederatePublishJSON(fed: HelicsFederate, json: str)

Publish data contained in a JSON file or string.

Parameters

  • fed - The value helics.HelicsFederate through which to publish the data.
  • json - The publication file name or literal JSON data string.

helicsFederateRegisterCloningFilter

def helicsFederateRegisterCloningFilter(fed: HelicsFederate, name: str) -> HelicsFilter

Create a cloning Filter on the specified federate. Cloning filters copy a message and send it to multiple locations, source and destination can be added through other functions.

Parameters

  • fed - The federate to register through.
  • name - The name of the filter (can be NULL).

Returns: helics.HelicsFilter.


helicsFederateRegisterEndpoint

def helicsFederateRegisterEndpoint(fed: HelicsFederate, name: str, type: str) -> HelicsEndpoint

MessageFederate Calls. Create an endpoint. The endpoint becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for endpoints.

Parameters

  • fed - The helics.HelicsFederate in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate.
  • name - The identifier for the endpoint. This will be prepended with the federate name for the global identifier.
  • type - A string describing the expected type of the publication (optional).

Returns: helics.HelicsEndpoint.


helicsFederateRegisterFilter

def helicsFederateRegisterFilter(fed: HelicsFederate, type: HelicsFilterType, name: str) -> HelicsFilter

Create a source Filter on the specified federate. Filters can be created through a federate or a core.handle, linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise equivalent behavior.

Parameters

  • fed - The federate to register through.
  • type - The type of filter to create helics.HelicsFilterType.
  • name - The name of the filter (can be NULL).

Returns: helics.HelicsFilter.


helicsFederateRegisterFromPublicationJSON

def helicsFederateRegisterFromPublicationJSON(fed: HelicsFederate, json: str)

Register the publications via JSON publication string.

Parameters

  • fed - The value helics.HelicsFederate to use to register the publications.
  • json - The JSON publication string.

helicsFederateRegisterGlobalCloningFilter

def helicsFederateRegisterGlobalCloningFilter(fed: HelicsFederate, name: str) -> HelicsFilter

Create a global cloning Filter on the specified federate. Cloning filters copy a message and send it to multiple locations, source and destination can be added through other functions.

Parameters

  • fed - The federate to register through.
  • name - The name of the filter (can be NULL).

Returns: helics.HelicsFilter.


helicsFederateRegisterGlobalEndpoint

def helicsFederateRegisterGlobalEndpoint(fed: HelicsFederate, name: str, type: str = "") -> HelicsEndpoint

Create an endpoint. The endpoint becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for endpoints.

Parameters

  • fed - The helics.HelicsFederate in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate.
  • name - The identifier for the endpoint.handle, the given name is the global identifier.
  • type - A string describing the expected type of the publication (optional).

Returns: helics.HelicsEndpoint.


helicsFederateRegisterGlobalFilter

def helicsFederateRegisterGlobalFilter(fed: HelicsFederate, type: HelicsFilterType, name: str) -> HelicsFilter

Create a global source filter through a federate. Filters can be created through a federate or a core.handle, linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise equivalent behavior.

Parameters

  • fed - The federate to register through.
  • type - The type of filter to create helics.HelicsFilterType.
  • name - The name of the filter (can be NULL).

Returns: helics.HelicsFilter.


helicsFederateRegisterGlobalInput

def helicsFederateRegisterGlobalInput(fed: HelicsFederate, name: str, type: HelicsDataType, units: str) -> HelicsPublication

Register a global named input. The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions and publications.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • name - The identifier for the publication.
  • type - A code identifying the type of the input see helics.HelicsDataType for available options.
  • units - A string listing the units of the subscription maybe NULL.

Returns: helics.HelicsPublication.


helicsFederateRegisterGlobalPublication

def helicsFederateRegisterGlobalPublication(fed: HelicsFederate, name: str, type: HelicsDataType, units: str = "") -> HelicsPublication

Register a global named publication with an arbitrary type. The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions and publications.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • name - The identifier for the publication.
  • type - A code identifying the type of the input see helics.HelicsDataType for available options.
  • units - A string listing the units of the subscription (optional).

Returns: helics.HelicsPublication.


helicsFederateRegisterGlobalTargetedEndpoint

def helicsFederateRegisterGlobalTargetedEndpoint(fed: HelicsFederate, name: str, type: str)

Create a globally targeted endpoint. The endpoint becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for endpoints.

Parameters

  • fed - The helics.HelicsFederate in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate.
  • name - The identifier for the endpoint. This will be prepended with the federate name for the global identifier.
  • type - A string describing the expected type of the publication (optional). Returns: helics.HelicsEndpoint.

helicsFederateRegisterGlobalTypeInput

def helicsFederateRegisterGlobalTypeInput(fed: HelicsFederate, name: str, type: str, units: str) -> HelicsInput

Register a global publication with an arbitrary type. The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions and publications.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • name - The identifier for the publication.
  • type - A string defining the type of the input.
  • units - A string listing the units of the subscription maybe NULL.

Returns: helics.HelicsPublication.


helicsFederateRegisterGlobalTypePublication

def helicsFederateRegisterGlobalTypePublication(fed: HelicsFederate, name: str, type: str, units: str) -> HelicsPublication

Register a global publication with a defined type. The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions and publications.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • name - The identifier for the publication.
  • type - A string describing the expected type of the publication.
  • units - A string listing the units of the subscription (optional).

Returns: helics.HelicsPublication.


helicsFederateRegisterInput

def helicsFederateRegisterInput(fed: HelicsFederate, name: str, type: HelicsDataType, units: str) -> HelicsInput

Register a named input. The input becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions, inputs, and publications.

Parameters

  • fed - The helics.HelicsFederate in which to create an input.
  • name - The identifier for the publication the global input name will be prepended with the federate name.
  • type - A code identifying the type of the input see helics.HelicsDataType for available options.
  • units - A string listing the units of the input (optional).

Returns: helics.HelicsInput.


helicsFederateRegisterInterfaces

def helicsFederateRegisterInterfaces(fed: HelicsFederate, file: str)

Load interfaces from a file.

Parameters

  • fed - The federate to which to load interfaces.
  • file - The name of a file to load the interfaces from either JSON, or TOML.

helicsFederateRegisterPublication

def helicsFederateRegisterPublication(fed: HelicsFederate, name: str, type: HelicsDataType, units: str) -> HelicsPublication

Register a publication with a known type. The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions and publications.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • name - The identifier for the publication the global publication name will be prepended with the federate name.
  • type - A code identifying the type of the input see helics.HelicsDataType for available options.
  • units - A string listing the units of the subscription (optional).

Returns: helics.HelicsPublication.


helicsFederateRegisterSubscription

def helicsFederateRegisterSubscription(fed: HelicsFederate, name: str, units: str = "") -> HelicsInput

Functions related to value federates for the C api. Create a subscription. The subscription becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions and publications.

Parameters

  • fed - The helics.HelicsFederate in which to create a subscription, must have been created with helics.helicsCreateValueFederate or helics.helicsCreateCombinationFederate.
  • name - The identifier matching a publication to get a subscription for.
  • units - A string listing the units of the subscription (optional).

Returns: helics.HelicsSubscription.


helicsFederateRegisterTargetedEndpoint

def helicsFederateRegisterTargetedEndpoint(fed: HelicsFederate, name: str, type: str)

Create an targeted endpoint. The endpoint becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for endpoints.

Parameters

  • fed - The helics.HelicsFederate in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate.
  • name - The identifier for the endpoint. This will be prepended with the federate name for the global identifier.
  • type - A string describing the expected type of the publication (optional). Returns: helics.HelicsEndpoint.

helicsFederateRegisterTypeInput

def helicsFederateRegisterTypeInput(fed: HelicsFederate, name: str, type: str, units: str) -> HelicsInput

Register an input with a defined type. The input becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions, inputs, and publications.

Parameters

  • fed - The helics.HelicsFederate in which to create an input.
  • name - The identifier for the input.
  • type - A string describing the expected type of the input.
  • units - A string listing the units of the input maybe NULL.

Returns: helics.HelicsPublication.


helicsFederateRegisterTypePublication

def helicsFederateRegisterTypePublication(fed: HelicsFederate, name: str, type: str, units: str) -> HelicsPublication

Register a publication with a defined type. The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions and publications.

Parameters

  • fed - The helics.HelicsFederate in which to create a publication.
  • name - The identifier for the publication.
  • type - A string labeling the type of the publication.
  • units - A string listing the units of the subscription (optional).

Returns: helics.HelicsPublication.


helicsFederateRequestNextStep

def helicsFederateRequestNextStep(fed: HelicsFederate) -> HelicsTime

Request the next time step for federate execution. Feds should have setup the period or minDelta for this to work well but it will request the next time step which is the current time plus the minimum time step.

Parameters

  • fed - The federate to make the request of.

Returns: helics.HelicsTime.


helicsFederateRequestTime

def helicsFederateRequestTime(fed: HelicsFederate, request_time: HelicsTime) -> HelicsTime

Request the next time for federate execution.

Parameters

  • fed - The federate to make the request of.
  • request_time - The next requested time.

Returns: helics.HelicsTime.


helicsFederateRequestTimeAdvance

def helicsFederateRequestTimeAdvance(fed: HelicsFederate, time_delta: HelicsTime) -> HelicsTime

Request the next time for federate execution.

Parameters

  • fed - The federate to make the request of.
  • time_delta - The requested amount of time to advance.

Returns: helics.HelicsTime.


helicsFederateRequestTimeAsync

def helicsFederateRequestTimeAsync(fed: HelicsFederate, request_time: HelicsTime)

Request the next time for federate execution in an asynchronous call. Call helics.helicsFederateRequestTimeComplete to finish the call.

Parameters

  • fed - The federate to make the request of.
  • request_time - The next requested time.

helicsFederateRequestTimeComplete

def helicsFederateRequestTimeComplete(fed: HelicsFederate) -> HelicsTime

Complete an asynchronous requestTime call.

Parameters

  • fed - The federate to make the request of.

helicsFederateRequestTimeIterative

def helicsFederateRequestTimeIterative(
    fed: HelicsFederate, request_time: HelicsTime, iterate: HelicsIterationRequest
) -> Tuple[HelicsTime, HelicsIterationResult]

Request an iterative time. This call allows for finer grain control of the iterative process than helics.helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status.

Parameters

  • fed - The federate to make the request of.
  • request_time - The next desired time.
  • iterate - helics.HelicsIterationRequest, i.e. the requested iteration mode.

Returns: (helics.HelicsTime, helics.HelicsIterationResult).


helicsFederateRequestTimeIterativeAsync

def helicsFederateRequestTimeIterativeAsync(fed: HelicsFederate, request_time: HelicsTime, iterate: HelicsIterationRequest)

Request an iterative time through an asynchronous call. This call allows for finer grain control of the iterative process than helics.helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status. Call helics.helicsFederateRequestTimeIterativeComplete to finish the process.

Parameters

  • fed - The federate to make the request of.
  • request_time - The next desired time.
  • iterate - helics.HelicsIterationRequest, i.e. the requested iteration mode.

helicsFederateRequestTimeIterativeComplete

def helicsFederateRequestTimeIterativeComplete(fed: HelicsFederate) -> Tuple[HelicsTime, HelicsIterationResult]

Complete an iterative time request asynchronous call.

Parameters

  • fed - The federate to make the request of.

Returns: The iteration specification of the result.


helicsFederateSendCommand

def helicsFederateSendCommand(fed: HelicsFederate, target: str, command: str)

helicsFederateSetFlagOption

def helicsFederateSetFlagOption(fed: HelicsFederate, flag: int, value: bool)

Set a flag for the federate.

Parameters

  • fed - The federate to alter a flag for.
  • flag - The flag to change.
  • value - The new value of the flag. 0 for false, !=0 for true.

helicsFederateSetGlobal

def helicsFederateSetGlobal(fed: HelicsFederate, name: str, value: str)

Set a federation global value through a federate. This overwrites any previous value for this name.

Parameters

  • fed - The federate to set the global through.
  • name - The name of the global to set.
  • value - The value of the global.

helicsFederateSetIntegerProperty

def helicsFederateSetIntegerProperty(fed: HelicsFederate, property: HelicsProperty, value: int)

Set an integer based property of a federate.

Parameters

  • fed - The federate to change the property for.
  • property - helics.HelicsProperty.
  • value - The value of the property.

helicsFederateSetLogFile

def helicsFederateSetLogFile(fed: HelicsFederate, log_file: str)

Set the logging file for a federate (actually on the core associated with a federate).

Parameters

  • fed - The federate to set the log file for.
  • log_file - The name of the log file.

helicsFederateSetLoggingCallback

def helicsFederateSetLoggingCallback(fed: HelicsFederate, logger, user_data)

Set the logging callback for a helics.HelicsFederate

Add a logging callback function for the C. The logging callback will be called when a message flows into a helics.HelicsFederate from the core or from a federate.

Parameters

  • fed: the helics.HelicsFederate that is created with helics.helicsCreateValueFederate, helics.helicsCreateMessageFederate or helics.helicsCreateCombinationFederate
  • logger: a callback with signature void(int, const char *, const char *, void *); the function arguments are loglevel, an identifier string, and a message string, and a pointer to user data
  • user_data: a pointer to user data that is passed to the function when executing

helicsFederateSetSeparator

def helicsFederateSetSeparator(fed: HelicsFederate, separator: str)

Set the separator character in a federate. The separator character is the separation character for local publications/endpoints in creating their global name. For example if the separator character is ‘/’ then a local endpoint would have a globally reachable name of fedName/localName.

Parameters

  • fed - The federate info object to alter.
  • separator - The character to use as a separator.

helicsFederateSetTimeProperty

def helicsFederateSetTimeProperty(fed: HelicsFederate, time_property: int, time: HelicsTime)

Set a time based property for a federate.

Parameters

  • fed - The helics.HelicsFederate to set the property for.
  • time_property - A integer code for a time property.
  • time - The requested value of the property.

helicsFederateWaitCommand

def helicsFederateWaitCommand(fed: HelicsFederate) -> str

helicsFilterAddDeliveryEndpoint

def helicsFilterAddDeliveryEndpoint(filter: HelicsFilter, delivery_endpoint: str)

Clone filter functions. Functions that manipulate cloning filters in some way. Add a delivery endpoint to a cloning filter. All cloned messages are sent to the delivery address(es).

Parameters

  • filter - The given filter.
  • delivery_endpoint - The name of the endpoint to deliver messages to.

helicsFilterAddDestinationTarget

def helicsFilterAddDestinationTarget(filter: HelicsFilter, destination: str)

Add a destination target to a filter. All messages going to a destination are copied to the delivery address(es).

Parameters

  • filter - The given filter to add a destination target to.
  • destination - The name of the endpoint to add as a destination target.

helicsFilterAddSourceTarget

def helicsFilterAddSourceTarget(filter: HelicsFilter, source_name: str)

Add a source target to a filter. All messages coming from a source are copied to the delivery address(es).

Parameters

  • filter - The given filter.
  • source_name - The name of the endpoint to add as a source target.

helicsFilterGetInfo

def helicsFilterGetInfo(filter: HelicsFilter) -> str

Get the data in the info field of a filter.

Parameters

  • filter - The given filter.

Returns: A string with the info field string.


helicsFilterGetName

def helicsFilterGetName(filter: HelicsFilter) -> str

Get the name of the filter and store in the given string.

Parameters

  • filter - The given filter.

Returns: A string with the name of the filter.


helicsFilterGetOption

def helicsFilterGetOption(filter: HelicsFilter, option: HelicsHandleOption) -> int

Get a handle option for the filter.

Parameters

  • filter - The given filter to query.
  • option - The option to query helics.HelicsHandleOption.

Returns: int.


helicsFilterIsValid

def helicsFilterIsValid(filter: HelicsFilter) -> bool

Check if a filter is valid.

Parameters

  • filter - The filter object to check.

Returns: True if the Filter object represents a valid filter.


helicsFilterRemoveDeliveryEndpoint

def helicsFilterRemoveDeliveryEndpoint(filter: HelicsFilter, delivery_endpoint: str)

Remove a delivery destination from a cloning filter.

Parameters

  • filter - The given filter (must be a cloning filter).
  • delivery_endpoint - A string with the delivery endpoint to remove.

helicsFilterRemoveTarget

def helicsFilterRemoveTarget(filter: HelicsFilter, target_name: str)

Remove a destination target from a filter.

Parameters

  • filter - The given filter.
  • target_name - The named endpoint to remove as a target.

helicsFilterSet

def helicsFilterSet(filter: HelicsFilter, property: str, value: float)

Set a property on a filter.

Parameters

  • filter - The filter to modify.
  • property - A string containing the property to set.
  • value - A numerical value for the property.

helicsFilterSetCustomCallback

def helicsFilterSetCustomCallback(filter: HelicsFilter, callback, userdata)

helicsFilterSetInfo

def helicsFilterSetInfo(filter: HelicsFilter, info: str)

Set the data in the info field for a filter

Parameters

  • filter - The given filter.
  • info - The string to set.

helicsFilterSetOption

def helicsFilterSetOption(filter: HelicsFilter, option: HelicsHandleOption, value: int)

Set the data in the info field for a filter.

Parameters

  • filter - The given filter.
  • option - The option to set helics.HelicsHandleOption.
  • value - The value of the option commonly 0 for false 1 for true.

helicsFilterSetString

def helicsFilterSetString(filter: HelicsFilter, property: str, value: str)

Set a string property on a filter.

Parameters

  • filter - The filter to modify.
  • property - A string containing the property to set.
  • value - A string containing the new value.

helicsGetBuildFlags

def helicsGetBuildFlags() -> str

Get the build flags used to compile HELICS.


helicsGetCompilerVersion

def helicsGetCompilerVersion() -> str

Get the compiler version used to compile HELICS.


helicsGetFederateByName

def helicsGetFederateByName(fed_name: str) -> HelicsFederate

Get an existing helics.HelicsFederate from a core by name. The federate must have been created by one of the other functions and at least one of the objects referencing the created federate must still be active in the process.

Parameters

  • fed_name - The name of the federate to retrieve.

Returns: helics.HelicsFederate.


helicsGetFlagIndex

def helicsGetFlagIndex(value: str) -> HelicsFederateFlag

Get a property index for use in helics.helicsFederateInfoSetFlagOption, helics.helicsFederateSetFlagOption.

Parameters

  • value - A string with the option name.

Returns: An int with the property code or (-1) if not a valid property.


helicsGetOptionIndex

def helicsGetOptionIndex(value: str) -> HelicsHandleOption

Get an option index for use in helics.helicsPublicationSetOption, helics.helicsInputSetOption, helics.helicsEndpointSetOption, helics.helicsFilterSetOption, and the corresponding get functions

Parameters

  • value - A string with the option name

Returns: An int with the option index or (-1) if not a valid property.


helicsGetOptionValue

def helicsGetOptionValue(value: str) -> int

Get an option value for use in helics.helicsPublicationSetOption, helics.helicsInputSetOption, helics.helicsEndpointSetOption, helics.helicsFilterSetOption.

Parameters

  • value - A string representing the value

Returns: An int with the option value or (-1) if not a valid value.


helicsGetPropertyIndex

def helicsGetPropertyIndex(value: str) -> HelicsProperty

Get a property index for use in helics.helicsFederateInfoSetFlagOption, helics.helicsFederateInfoSetTimeProperty, or helics.helicsFederateInfoSetIntegerProperty.

Parameters

  • value - A string with the property name.

Returns: An int with the property code or (-1) if not a valid property.


helicsGetVersion

def helicsGetVersion() -> str

Get a version string for HELICS.


helicsInputAddTarget

def helicsInputAddTarget(ipt: HelicsInput, target_name: str)

Add a publication to the list of data that an input subscribes to.

Parameters

  • ipt - The named input to modify.
  • target_name - The name of a publication that an input should subscribe to.

helicsInputClearUpdate

def helicsInputClearUpdate(ipt: HelicsInput)

Clear the updated flag from an input.


helicsInputGetBoolean

def helicsInputGetBoolean(ipt: HelicsInput) -> bool

Get a boolean value from a subscription.

Parameters

  • ipt - The input to get the data for.

Returns: A boolean value of current input value.


helicsInputGetByteCount

def helicsInputGetByteCount(ipt: HelicsInput) -> int

Data can be returned in a number of formats, for instance if data is published as a double it can be returned as a string and vice versa, not all translations make that much sense but they do work. Get the size of the raw value for subscription.

Returns: The size of the raw data/string in bytes.


helicsInputGetBytes

def helicsInputGetBytes(ipt: HelicsInput) -> bytes

Get the raw data for the latest value of a subscription.

Parameters

  • ipt - The input to get the data for.

Returns: Raw string data.


helicsInputGetChar

def helicsInputGetChar(ipt: HelicsInput) -> str

Get a single character value from an input.

Parameters

  • ipt - The input to get the data for.

Returns: The resulting character value.


helicsInputGetComplex

def helicsInputGetComplex(ipt: HelicsInput) -> Tuple[float, float]

Get a pair of double forming a complex number from a subscriptions.

Parameters

  • ipt - The input to get the data for.

Returns: a pair of floating point values that represent the real and imag values


helicsInputGetComplexObject

def helicsInputGetComplexObject(ipt: HelicsInput) -> Tuple[float, float]

Get a complex object from an input object.

Parameters

  • ipt - The input to get the data for.

Returns: complex.


helicsInputGetDouble

def helicsInputGetDouble(ipt: HelicsInput) -> float

Get a double value from a subscription..

Parameters

  • ipt - The input to get the data for.

Returns: The double value of the input.


helicsInputGetExtractionUnits

def helicsInputGetExtractionUnits(ipt: HelicsInput) -> str

Get the units of an input. The same as helics.helicsInputGetUnits.

Parameters

  • ipt - The input to query.

Returns: A string with the units information.


helicsInputGetInfo

def helicsInputGetInfo(ipt: HelicsInput) -> str

Get the data in the info field of an input.

Parameters

  • ipt - The input to query.

Returns: A string with the info field string.


helicsInputGetInjectionUnits

def helicsInputGetInjectionUnits(ipt: HelicsInput) -> str

Get the units of the publication that an input is linked to.

Parameters

  • ipt - The input to query.

Returns: A string with the units information.


helicsInputGetInteger

def helicsInputGetInteger(ipt: HelicsInput) -> int

Get an integer value from a subscription.

Parameters

  • ipt - The input to get the data for.

Returns: An int64_t value with the current value of the input.


helicsInputGetKey

def helicsInputGetKey(ipt: HelicsInput) -> str

Get the name of an input.

Parameters

  • ipt - The input to query

Returns: A string with the name information.


helicsInputGetName

def helicsInputGetName(ipt: HelicsInput) -> str

Get the name of an input.

Parameters

  • ipt - The input to query

Returns: A string with the name information.


helicsInputGetNamedPoint

def helicsInputGetNamedPoint(ipt: HelicsInput) -> Tuple[str, float]

Get a named point from a subscription.

Parameters

  • ipt - The input to get the result for.

Returns: a string and a double value for the named point


helicsInputGetOption

def helicsInputGetOption(ipt: HelicsInput, option: HelicsHandleOption) -> int

Get the current value of an input handle option.

Parameters

  • ipt - The input to query.
  • option - Integer representation of the option in question see helics.HelicsHandleOption.

Returns: An integer value with the current value of the given option.


helicsInputGetPublicationType

def helicsInputGetPublicationType(ipt: HelicsInput) -> str

Get the type the publisher to an input is sending.

Parameters

  • ipt - The input to query

Returns: A string with the type information.


helicsInputGetRawValue

def helicsInputGetRawValue(ipt: HelicsInput) -> bytes

Get the raw data for the latest value of a subscription.

Parameters

  • ipt - The input to get the data for.

Returns: Raw string data.

DEPRECATED


helicsInputGetRawValueSize

def helicsInputGetRawValueSize(ipt: HelicsInput) -> int

Data can be returned in a number of formats, for instance if data is published as a double it can be returned as a string and vice versa, not all translations make that much sense but they do work. Get the size of the raw value for subscription.

Returns: The size of the raw data/string in bytes.

DEPRECATED


helicsInputGetString

def helicsInputGetString(ipt: HelicsInput) -> str

Get a string value from a subscription.

Parameters

  • ipt - The input to get the data for.

Returns: A string data


helicsInputGetStringSize

def helicsInputGetStringSize(ipt: HelicsInput) -> int

Get the size of a value for subscription assuming return as a string.

Returns: The size of the string.


helicsInputGetTime

def helicsInputGetTime(ipt: HelicsInput) -> HelicsTime

Get a time value from a subscription.

Parameters

  • ipt - The input to get the data for.

Returns: The resulting time value.


helicsInputGetType

def helicsInputGetType(ipt: HelicsInput) -> str

Get the type of an input.

Parameters

  • ipt - The input to query

Returns: A string with the type information.


helicsInputGetUnits

def helicsInputGetUnits(ipt: HelicsInput) -> str

Get the units of an input.

Parameters

  • ipt - The input to query.

Returns: A string with the units information.


helicsInputGetVector

def helicsInputGetVector(ipt: HelicsInput) -> List[float]

Get a vector from a subscription.

Parameters

  • ipt - The input to get the result for.

Returns: a list of floating point values


helicsInputGetVectorSize

def helicsInputGetVectorSize(ipt: HelicsInput) -> int

Get the size of a value for subscription assuming return as an array of doubles.

Returns: The number of doubles in a returned vector.


helicsInputIsUpdated

def helicsInputIsUpdated(ipt: HelicsInput) -> bool

Check if a particular subscription was updated.

Returns: True if it has been updated since the last value retrieval.


helicsInputIsValid

def helicsInputIsValid(ipt: HelicsInput) -> bool

Check if an input is valid.

Parameters

  • ipt - The input to check

Returns: True if the Input object represents a valid input.


helicsInputLastUpdateTime

def helicsInputLastUpdateTime(ipt: HelicsInput) -> HelicsTime

Get the last time a subscription was updated.


helicsInputSetDefaultBoolean

def helicsInputSetDefaultBoolean(ipt: HelicsInput, value: bool)

Set the default as a boolean.

Parameters

  • ipt - The input to set the default for.
  • value - The default boolean value.

helicsInputSetDefaultBytes

def helicsInputSetDefaultBytes(ipt: HelicsInput, data: bytes)

Default Value functions. These functions set the default value for a subscription. That is the value returned if nothing was published from elsewhere. Set the default as a raw data array.

Parameters

  • ipt - The input to set the default for.
  • data - A pointer to the raw data to use for the default.

helicsInputSetDefaultChar

def helicsInputSetDefaultChar(ipt: HelicsInput, value: str)

Set the default as a char.

Parameters

  • ipt - The input to set the default for.
  • value - The default char value.

helicsInputSetDefaultComplex

def helicsInputSetDefaultComplex(ipt: HelicsInput, real: float, imag: float = 0)

Set the default as a complex number.

Parameters

  • ipt - The input to set the default for.
  • real - The default real value.
  • imag - The default imaginary value.

helicsInputSetDefaultDouble

def helicsInputSetDefaultDouble(ipt: HelicsInput, value: float)

Set the default as a double.

Parameters

  • ipt - The input to set the default for.
  • value - The default double value.

helicsInputSetDefaultInteger

def helicsInputSetDefaultInteger(ipt: HelicsInput, value: int)

Set the default as an integer.

Parameters

  • ipt - The input to set the default for.
  • value - The default integer.

helicsInputSetDefaultNamedPoint

def helicsInputSetDefaultNamedPoint(ipt: HelicsInput, string: str, value: float)

Set the default as a NamedPoint.

Parameters

  • ipt - The input to set the default for.
  • string - A pointer to a string representing the name.
  • value - A double value for the value of the named point.

helicsInputSetDefaultRaw

def helicsInputSetDefaultRaw(ipt: HelicsInput, data: bytes)

Default Value functions. These functions set the default value for a subscription. That is the value returned if nothing was published from elsewhere. Set the default as a raw data array.

Parameters

  • ipt - The input to set the default for.
  • data - A pointer to the raw data to use for the default.

DEPRECATED


helicsInputSetDefaultString

def helicsInputSetDefaultString(ipt: HelicsInput, string: str)

Set the default as a string.

Parameters

  • ipt - The input to set the default for.
  • string - A pointer to the default string.

helicsInputSetDefaultTime

def helicsInputSetDefaultTime(ipt: HelicsInput, value: HelicsTime)

Set the default as a time.

Parameters

  • ipt - The input to set the default for.
  • value - The default time value.

helicsInputSetDefaultVector

def helicsInputSetDefaultVector(ipt: HelicsInput, vectorInput: List[float])

Set the default as a vector of doubles.

Parameters

  • ipt - The input to set the default for.
  • vectorInput - A pointer to an array of double data.

helicsInputSetInfo

def helicsInputSetInfo(ipt: HelicsInput, info: str)

Set the data in the info field for an input.

Parameters

  • ipt - The input to query.
  • info - The string to set.

helicsInputSetMinimumChange

def helicsInputSetMinimumChange(ipt: HelicsInput, tolerance: float)

Set the minimum change detection tolerance.

Parameters

  • ipt - The input to modify.
  • tolerance - The tolerance level for registering an update, values changing less than this value will not show asbeing updated.

helicsInputSetOption

def helicsInputSetOption(ipt: HelicsInput, option: HelicsHandleOption, value: int)

Set an option on an input.

Parameters

  • ipt - The input to query.
  • option - The option to set for the input helics.HelicsHandleOption.
  • value - The value to set the option to.

helicsIsCoreTypeAvailable

def helicsIsCoreTypeAvailable(type: str) -> bool

Returns True if core/broker type specified is available in current compilation.

Parameters

  • type - A string representing a core type. Options include “zmq”, “udp”, “ipc”, “interprocess”, “tcp”, “default”, “mpi”.

Returns: True if type is available, False if type is not available.


helicsLoadSignalHandler

def helicsLoadSignalHandler()

Load a signal handler that handles Ctrl-C and shuts down the library


helicsLoadSignalHandlerCallback

def helicsLoadSignalHandlerCallback()

helicsMessageAppendData

def helicsMessageAppendData(message: HelicsMessage, data: bytes)

Append data to the payload.

Parameters

  • message - The message object in question.
  • data - A string containing the message data to append.

helicsMessageCheckFlag

def helicsMessageCheckFlag(message: HelicsMessage, flag: int) -> bool

Check if a flag is set on a message.

Parameters

  • message - The message object in question.
  • flag - The flag to check should be between [0,15].

Returns: The flags associated with a message.

DEPRECATED


helicsMessageClearFlags

def helicsMessageClearFlags(message: HelicsMessage)

Clear the flags of a message.

Parameters

  • message - The message object in question.

helicsMessageClone

def helicsMessageClone(message: HelicsMessage) -> HelicsMessage

Clone a message object.

Parameters

  • message - The message object to copy from.

Returns: helics.HelicsMessage.


helicsMessageCopy

def helicsMessageCopy(source_message: HelicsMessage, destination_message: HelicsMessage)

Copy a message object.

Parameters

  • source_message - The message object to copy from.
  • destination_message - The message object to copy to.

helicsMessageFree

def helicsMessageFree(message: HelicsMessage)

Free a message object from memory. Memory for message is managed so not using this function does not create memory leaks, this is an indication to the system that the memory for this message is done being used and can be reused for a new message. helics.helicsFederateClearMessages can also be used to clear up all stored messages at once.


helicsMessageGetByteCount

def helicsMessageGetByteCount(message: HelicsMessage) -> int

Get the size of the data payload in bytes.

Parameters

  • message - The message object in question.

Returns: The size of the data payload.


helicsMessageGetBytes

def helicsMessageGetBytes(message: HelicsMessage) -> bytes

Get the raw data for a message object.

Parameters

  • message - A message object to get the data for.

Returns: Raw string data.


helicsMessageGetBytesPointer

def helicsMessageGetBytesPointer(message: HelicsMessage) -> pointer

Get a pointer to the raw data of a message.

Parameters

  • message - A message object to get the data for.

Returns: A pointer to the raw data in memory, the pointer may be NULL if the message is not a valid message.


helicsMessageGetDestination

def helicsMessageGetDestination(message: HelicsMessage) -> str

Get the destination endpoint of a message.

Parameters

  • message - The message object in question.

Returns: A string with the destination endpoint.


helicsMessageGetFlagOption

def helicsMessageGetFlagOption(message: HelicsMessage, flag: int) -> bool

Get flag on a message.

Parameters

  • message - The message object in question.
  • flag - The flag to check should be between [0,15].

Returns: The flags associated with a message.


helicsMessageGetMessageID

def helicsMessageGetMessageID(message: HelicsMessage) -> int

Get the messageID of a message.

Parameters

  • message - The message object in question.

Returns: The messageID.


helicsMessageGetOriginalDestination

def helicsMessageGetOriginalDestination(message: HelicsMessage) -> str

Get the original destination endpoint of a message, the destination may have been modified by filters or other actions.

Parameters

  • message - The message object in question.

Returns: A string with the original destination of a message.


helicsMessageGetOriginalSource

def helicsMessageGetOriginalSource(message: HelicsMessage) -> str

Get the original source endpoint of a message, the source may have been modified by filters or other actions.

Parameters

  • message - The message object in question.

Returns: A string with the source of a message.


helicsMessageGetRawData

def helicsMessageGetRawData(message: HelicsMessage) -> bytes

Get the raw data for a message object.

Parameters

  • message - A message object to get the data for.

Returns: Raw string data.

DEPRECATED


helicsMessageGetRawDataPointer

def helicsMessageGetRawDataPointer(message: HelicsMessage) -> pointer

Get a pointer to the raw data of a message.

Parameters

  • message - A message object to get the data for.

Returns: A pointer to the raw data in memory, the pointer may be NULL if the message is not a valid message.

DEPRECATED


helicsMessageGetRawDataSize

def helicsMessageGetRawDataSize(message: HelicsMessage) -> int

Get the size of the data payload in bytes.

Parameters

  • message - The message object in question.

Returns: The size of the data payload.

DEPRECATED


helicsMessageGetSource

def helicsMessageGetSource(message: HelicsMessage) -> str

Message operation functions. Functions for working with helics message envelopes. Get the source endpoint of a message.

Parameters

  • message - The message object in question.

Returns: A string with the source endpoint.


helicsMessageGetString

def helicsMessageGetString(message: HelicsMessage) -> str

Get the payload of a message as a string.

Parameters

  • message - The message object in question.

Returns: A string representing the payload of a message.


helicsMessageGetTime

def helicsMessageGetTime(message: HelicsMessage) -> HelicsTime

Get the helics time associated with a message.

Parameters

  • message - The message object in question.

Returns: The time associated with a message.


helicsMessageIsValid

def helicsMessageIsValid(message: HelicsMessage) -> bool

A check if the message contains a valid payload.

Parameters

  • message - The message object in question.

Returns: True if the message contains a payload.


helicsMessageReserve

def helicsMessageReserve(message: HelicsMessage, reserve_size: int)

Reserve space in a buffer but don’t actually resize. The message data buffer will be reserved but not resized.

Parameters

  • message - The message object in question.
  • reserve_size - The number of bytes to reserve in the message object.

helicsMessageResize

def helicsMessageResize(message: HelicsMessage, new_size: int)

Resize the data buffer for a message. The message data buffer will be resized. There are no guarantees on what is in the buffer in newly allocated space. If the allocated space is not sufficient new allocations will occur

Parameters

  • message - The message object in question.
  • new_size - The new size in bytes of the buffer.

helicsMessageSetData

def helicsMessageSetData(message: HelicsMessage, data: bytes)

Set the data payload of a message as raw data.

Parameters

  • message - The message object in question.
  • data - A string containing the message data.

helicsMessageSetDestination

def helicsMessageSetDestination(message: HelicsMessage, destination: str)

Set the destination of a message.

Parameters

  • message - The message object in question.
  • destination - A string containing the new destination.

helicsMessageSetFlagOption

def helicsMessageSetFlagOption(message: HelicsMessage, flag: int, value: bool)

Set a flag on a message.

Parameters

  • message - The message object in question.
  • flag - An index of a flag to set on the message.
  • value - The desired value of the flag.

helicsMessageSetMessageID

def helicsMessageSetMessageID(message: HelicsMessage, message_id: int)

Set the message ID for the message. Normally this is not needed and the core of HELICS will adjust as needed.

Parameters

  • message - The message object in question.
  • message_id - A new message ID.

helicsMessageSetOriginalDestination

def helicsMessageSetOriginalDestination(message: HelicsMessage, destination: str)

Set the original destination of a message.

Parameters

  • message - The message object in question.
  • destination - A string containing the new original source.

helicsMessageSetOriginalSource

def helicsMessageSetOriginalSource(message: HelicsMessage, source: str)

Set the original source of a message.

Parameters

  • message - The message object in question.
  • source - A string containing the new original source.

helicsMessageSetSource

def helicsMessageSetSource(message: HelicsMessage, source: str)

Set the source of a message.

Parameters

  • message - The message object in question.
  • source - A string containing the source.

helicsMessageSetString

def helicsMessageSetString(message: HelicsMessage, string: str)

Set the data payload of a message as a string.

Parameters

  • message - The message object in question.
  • string - A string containing the message data.

helicsMessageSetTime

def helicsMessageSetTime(message: HelicsMessage, time: HelicsTime)

Set the delivery time for a message.

Parameters

  • message - The message object in question.
  • time - The time the message should be delivered.

helicsPublicationAddTarget

def helicsPublicationAddTarget(pub: HelicsPublication, target_name: str)

Add a named input to the list of targets a publication publishes to.

Parameters

  • pub - The publication to add the target for.
  • target_name - The name of an input that the data should be sent to.

helicsPublicationGetInfo

def helicsPublicationGetInfo(pub: HelicsPublication) -> str

Get the data in the info field of an publication.

Parameters

  • pub - The publication to query.

Returns: A string with the info field string.


helicsPublicationGetKey

def helicsPublicationGetKey(pub: HelicsPublication) -> str

Get the name of a publication. This will be the global name used to identify the publication to the federation.

Parameters

  • pub - The publication to query.

Returns: A string with the units information.


helicsPublicationGetName

def helicsPublicationGetName(pub: HelicsPublication) -> str

Get the name of a publication. This will be the global name used to identify the publication to the federation.

Parameters

  • pub - The publication to query.

Returns: A string with the units information.


helicsPublicationGetOption

def helicsPublicationGetOption(pub: HelicsPublication, option: HelicsHandleOption) -> int

Get the value of an option for a publication.

Parameters

  • pub - The publication to query.
  • option - The value to query see helics.HelicsHandleOption.

Returns: A string with the info field string.


helicsPublicationGetType

def helicsPublicationGetType(pub: HelicsPublication) -> str

Get the type of a publication.

Parameters

  • pub - The publication to query

Returns: A string with the publication type information.


helicsPublicationGetUnits

def helicsPublicationGetUnits(pub: HelicsPublication) -> str

Get the units of a publication.

Parameters

  • pub - The publication to query.

Returns: A string with the units information.


helicsPublicationIsValid

def helicsPublicationIsValid(pub: HelicsPublication) -> bool

Publication functions. Functions for publishing data of various kinds. The data will get translated to the type specified when the publication was constructed automatically regardless of the function used to publish the data. Check if a publication is valid.

Parameters

  • pub - The publication to check

Returns: True if the publication is a valid publication.


helicsPublicationPublishBoolean

def helicsPublicationPublishBoolean(pub: HelicsPublication, value: bool)

Publish a Boolean Value.

Parameters

  • pub - The publication to publish for.
  • value - The boolean value to publish.

helicsPublicationPublishBytes

def helicsPublicationPublishBytes(pub: HelicsPublication, data: bytes)

Publish raw data from a char * and length.

Parameters

  • pub - The publication to publish for.
  • data - A pointer to the raw data.

helicsPublicationPublishChar

def helicsPublicationPublishChar(pub: HelicsPublication, value: str)

Publish a single character.

Parameters

  • pub - The publication to publish for.
  • value - The numerical value to publish.

helicsPublicationPublishComplex

def helicsPublicationPublishComplex(pub: HelicsPublication, real: float, imag: float = 0)

Publish a complex value (or pair of values).

Parameters

  • pub - The publication to publish for.
  • real - float number or complex number
  • imag - float number

helicsPublicationPublishDouble

def helicsPublicationPublishDouble(pub: HelicsPublication, value: float)

Publish a double floating point value.

Parameters

  • pub - The publication to publish for.
  • value - The numerical value to publish.

helicsPublicationPublishInteger

def helicsPublicationPublishInteger(pub: HelicsPublication, value: int)

Publish an integer value.

Parameters

  • pub - The publication to publish for.
  • value - The numerical value to publish.

helicsPublicationPublishNamedPoint

def helicsPublicationPublishNamedPoint(pub: HelicsPublication, string: str, value: float)

Publish a named point.

Parameters

  • pub - The publication to publish for.
  • string - A string for the name to publish.
  • value - A double for the value to publish.

helicsPublicationPublishRaw

def helicsPublicationPublishRaw(pub: HelicsPublication, data: bytes)

Publish raw data from a char * and length.

Parameters

  • pub - The publication to publish for.
  • data - A pointer to the raw data.

DEPRECATED


helicsPublicationPublishString

def helicsPublicationPublishString(pub: HelicsPublication, string: str)

Publish a string.

Parameters

  • pub - The publication to publish for.
  • string - The string to publish.

helicsPublicationPublishTime

def helicsPublicationPublishTime(pub: HelicsPublication, value: HelicsTime)

Publish a time value.

Parameters

  • pub - The publication to publish for.
  • value - The numerical value to publish.

helicsPublicationPublishVector

def helicsPublicationPublishVector(pub: HelicsPublication, vectorInput: List[float])

Publish a vector of doubles.

Parameters

  • pub - The publication to publish for.
  • vectorInput - A pointer to an array of double data.

helicsPublicationSetInfo

def helicsPublicationSetInfo(pub: HelicsPublication, info: str)

Set the data in the info field for a publication.

Parameters

  • pub - The publication to set the info field for.
  • info - The string to set.

helicsPublicationSetMinimumChange

def helicsPublicationSetMinimumChange(pub: HelicsPublication, tolerance: float)

Set the minimum change detection tolerance.

Parameters

  • pub - The publication to modify.
  • tolerance - The tolerance level for publication, values changing less than this value will not be published.

helicsPublicationSetOption

def helicsPublicationSetOption(pub: HelicsPublication, option: HelicsHandleOption, value: int)

Set the value of an option for a publication.

Parameters

  • pub - The publication to query.
  • option - Integer code for the option to set helics.HelicsHandleOption.
  • value - The value to set the option to.

helicsQueryBrokerExecute

def helicsQueryBrokerExecute(query: HelicsQuery, broker: HelicsBroker) -> JSONType

Execute a query directly on a broker. The call will block until the query finishes which may require communication or other delays.

Parameters

  • query - The query object to use in the query.
  • broker - The broker to send the query to.

Returns: String that contains the result of the query that was executed.


helicsQueryCoreExecute

def helicsQueryCoreExecute(query: HelicsQuery, core: HelicsCore) -> JSONType

Execute a query directly on a core. The call will block until the query finishes which may require communication or other delays.

Parameters

  • query - The query object to use in the query.
  • core - The core to send the query to.

Returns: String that contains the result of the query that was executed.


helicsQueryExecute

def helicsQueryExecute(query: HelicsQuery, fed: HelicsFederate) -> JSONType

Execute a query. The call will block until the query finishes which may require communication or other delays.

Parameters

  • query - The query object to use in the query.
  • fed - A federate to send the query through.

Returns: String that contains the result of the query that was executed.


helicsQueryExecuteAsync

def helicsQueryExecuteAsync(query: HelicsQuery, fed: HelicsFederate)

Execute a query in a non-blocking call.

Parameters

  • query - The query object to use in the query.
  • fed - A federate to send the query through.

helicsQueryExecuteComplete

def helicsQueryExecuteComplete(query: HelicsQuery) -> JSONType

Complete the return from a query called with helics.helicsExecuteQueryAsync. The function will block until the query completes isQueryComplete can be called to determine if a query has completed or not.

Parameters

  • query - The query object to complete execution of.

Returns: String that contains the result of the query that was executed.


helicsQueryFree

def helicsQueryFree(query: HelicsQuery)

Free the memory associated with a query object.


helicsQueryIsCompleted

def helicsQueryIsCompleted(query: HelicsQuery) -> bool

Check if an asynchronously executed query has completed. This function should usually be called after a QueryExecuteAsync function has been called.

Parameters

  • query - The query object to check if completed

Returns: Will return True if an asynchronous query has completed or a regular query call was made with a result, and false if an asynchronous query has not completed or is invalid.


helicsQuerySetOrdering

def helicsQuerySetOrdering(query: HelicsQuery, mode: int)

Update the ordering mode of the query, fast runs on priority channels, ordered goes on normal channels but goes in sequence

Parameters

  • query: The query object to change the order for.
  • mode: 0 for fast, 1 for ordered.

helicsQuerySetQueryString

def helicsQuerySetQueryString(query: HelicsQuery, query_string: str)

Update the queryString of a query.

Parameters

  • query - The query object to change the target of.
  • query_string - the new queryString.

helicsQuerySetTarget

def helicsQuerySetTarget(query: HelicsQuery, target_name: str)

Update the target of a query.

Parameters

  • query - The query object to change the target of.
  • target_name - the name of the target to query.

helicsSubscriptionGetKey

def helicsSubscriptionGetKey(ipt: HelicsInput) -> str

Get the name of a subscription.

Returns: A string with the subscription name.


helicsSubscriptionGetTarget

def helicsSubscriptionGetTarget(ipt: HelicsInput) -> str

Get the target of a subscription.

Returns: A string with the subscription target.


loadSym

def loadSym(s)