API

This is the Julia API for the HELICS library.

julia> using HELICS; const h = HELICS;

julia> h.helicsGetVersion()
"2.4.2 (2020-03-27)"

Enum

HELICS.HELICS_CORE_TYPEType

Pick a core type depending on compile configuration

  • HELICS_CORE_TYPE_DEFAULT: a default core type that will default to something available (0)
  • HELICS_CORE_TYPE_ZMQ: use the Zero MQ networking protocol (1)
  • HELICS_CORE_TYPE_MPI: use MPI for operation on a parallel cluster (2)
  • HELICS_CORE_TYPE_TEST: use the Test core if all federates are in the same process (3)
  • HELICS_CORE_TYPE_INTERPROCESS: interprocess uses memory mapped files to transfer data (for use when all federates are on the same machine (4)
  • HELICS_CORE_TYPE_IPC: interprocess uses memory mapped files to transfer data (for use when all federates are on the same machine ipc is the same as HELICS_CORE_TYPE_INTERPROCESS (5)
  • HELICS_CORE_TYPE_TCP: use a generic TCP protocol message stream to send messages (6)
  • HELICS_CORE_TYPE_UDP: use UDP packets to send the data (7)
  • HELICS_CORE_TYPE_ZMQ_TEST: single socket version of ZMQ core usually for high fed count on the same system (10)
  • HELICS_CORE_TYPE_NNG: for using the nanomsg communications (9)
  • HELICS_CORE_TYPE_TCP_SS: a single socket version of the TCP core for more easily handling firewalls (11)
  • HELICS_CORE_TYPE_HTTP: a core type using http for communication (12)
  • HELICS_CORE_TYPE_WEBSOCKET: a core using websockets for communication (14)
  • HELICS_CORE_TYPE_INPROC: an in process core type for handling communications in shared memory it is pretty similar to the test core but stripped from the "test" components (18)
  • HELICS_CORE_TYPE_NULL: an explicit core type that is recognized but explicitly doesn't exist, for testing and a few other assorted reasons (66)
source
HELICS.HELICS_DATA_TYPEType

Enumeration of allowable data types for publications and inputs

  • HELICS_DATA_TYPE_STRING: a sequence of characters (0)
  • HELICS_DATA_TYPE_DOUBLE: a double precision floating point number (1)
  • HELICS_DATA_TYPE_INT: a 64 bit integer (2)
  • HELICS_DATA_TYPE_COMPLEX: a pair of doubles representing a complex number (3)
  • HELICS_DATA_TYPE_VECTOR: an array of doubles (4)
  • HELICS_DATA_TYPE_COMPLEX_VECTOR: a complex vector object (5)
  • HELICS_DATA_TYPE_NAMED_POINT: a named point consisting of a string and a double (6)
  • HELICS_DATA_TYPE_BOOLEAN: a boolean data type (7)
  • HELICS_DATA_TYPE_TIME: time data type (8)
  • HELICS_DATA_TYPE_RAW: raw data type (25)
  • HELICS_DATA_TYPE_ANY: open type that can be anything (25262)
source
HELICS.HELICS_ERROR_TYPESType

Enumeration of return values from the C interface functions

  • HELICS_OK: the function executed successfully (0)
  • HELICS_ERROR_REGISTRATION_FAILURE: registration has failed (-1)
  • HELICS_ERROR_CONNECTION_FAILURE: the operation to connect has failed (-2)
  • HELICS_ERROR_INVALID_OBJECT: indicator that the object used was not a valid object (-3)
  • HELICS_ERROR_INVALID_ARGUMENT: the parameter passed was invalid and unable to be used (-4)
  • HELICS_ERROR_DISCARD: the input was discarded and not used for some reason (-5)
  • HELICS_ERROR_SYSTEM_FAILURE: the federate has terminated unexpectedly and the call cannot be completed (-6)
  • HELICS_WARNING: the function issued a warning of some kind (-8)
  • HELICS_ERROR_INVALID_STATE_TRANSITION: error issued when an invalid state transition occurred (-9)
  • HELICS_ERROR_INVALID_FUNCTION_CALL: the call made was invalid in the present state of the calling object (-10)
  • HELICS_ERROR_EXECUTION_FAILURE: the function execution has failed (-14)
  • HELICS_ERROR_INSUFFICIENT_SPACE: insufficient space is available to store requested data (-18)
  • HELICS_ERROR_OTHER: the function produced a helics error of some other type (-101)
  • HELICS_ERROR_FATAL: global fatal error for federation (-404)
  • HELICS_ERROR_EXTERNAL_TYPE: an unknown non-helics error was produced (-203)
source
HELICS.HELICS_FEDERATE_FLAGSType

Enumeration of possible federate flags

  • HELICS_FLAG_OBSERVER: flag indicating that a federate is observe only (0)
  • HELICS_FLAG_UNINTERRUPTIBLE: flag indicating that a federate can only return requested times (1)
  • HELICS_FLAG_INTERRUPTIBLE: flag indicating that a federate can be interrupted (2)
  • HELICS_FLAG_SOURCE_ONLY: flag indicating that a federate/interface is a signal generator only (4)
  • HELICS_FLAG_ONLY_TRANSMIT_ON_CHANGE: flag indicating a federate/interface should only transmit values if they have changed(binary equivalence) (6)
  • HELICS_FLAG_ONLY_UPDATE_ON_CHANGE: flag indicating a federate/interface should only trigger an update if a value has changed (binary equivalence) (8)
  • HELICS_FLAG_WAIT_FOR_CURRENT_TIME_UPDATE: flag indicating a federate should only grant time if all other federates have already passed the requested time (10)
  • HELICS_FLAG_RESTRICTIVE_TIME_POLICY: flag indicating a federate should operate on a restrictive time policy, which disallows some 2nd order time evaluation and can be useful for certain types of dependency cycles and update patterns, but generally shouldn't be used as it can lead to some very slow update conditions (11)
  • HELICS_FLAG_ROLLBACK: flag indicating that a federate has rollback capability (12)
  • HELICS_FLAG_FORWARD_COMPUTE: flag indicating that a federate performs forward computation and does internal rollback (14)
  • HELICS_FLAG_REALTIME: flag indicating that a federate needs to run in real time (16)
  • HELICS_FLAG_SINGLE_THREAD_FEDERATE: flag indicating that the federate will only interact on a single thread (27)
  • HELICS_FLAG_SLOW_RESPONDING: flag specifying that a federate, core, or broker may be slow to respond to pings If the federate goes offline there is no good way to detect it so use with caution (29)
  • HELICS_FLAG_DELAY_INIT_ENTRY: used to delay a core from entering initialization mode even if it would otherwise be ready (45)
  • HELICS_FLAG_ENABLE_INIT_ENTRY: used to clear the HELICS_DELAY_INIT_ENTRY flag in cores (47)
  • HELICS_FLAG_IGNORE_TIME_MISMATCH_WARNINGS: used to not display warnings on mismatched requested times (67)
  • HELICS_FLAG_TERMINATE_ON_ERROR: specify that a federate error should terminate the federation (72)
source
HELICS.HELICS_FEDERATE_STATEType

Enumeration of possible federate states

  • HELICS_STATE_STARTUP: when created the federate is in startup state (0)
  • HELICS_STATE_INITIALIZATION: entered after the enterInitializingMode call has returned (1)
  • HELICS_STATE_EXECUTION: entered after the enterExectuationState call has returned (2)
  • HELICS_STATE_FINALIZE: the federate has finished executing normally final values may be retrieved (3)
  • HELICS_STATE_ERROR: error state no core communication is possible but values can be retrieved the following states are for asynchronous operations (4)
  • HELICS_STATE_PENDING_INIT: indicator that the federate is pending entry to initialization state (5)
  • HELICS_STATE_PENDING_EXEC: state pending EnterExecution State (6)
  • HELICS_STATE_PENDING_TIME: state that the federate is pending a timeRequest (7)
  • HELICS_STATE_PENDING_ITERATIVE_TIME: state that the federate is pending an iterative time request (8)
  • HELICS_STATE_PENDING_FINALIZE: state that the federate is pending a finalize request (9)
source
HELICS.HELICS_FILTER_TYPEType

Enumeration of the predefined filter types

  • HELICS_FILTER_TYPE_CUSTOM: a custom filter type that executes a user defined callback (0)
  • HELICS_FILTER_TYPE_DELAY: a filter type that executes a fixed delay on a message (1)
  • HELICS_FILTER_TYPE_RANDOM_DELAY: a filter type that executes a random delay on the messages (2)
  • HELICS_FILTER_TYPE_RANDOM_DROP: a filter type that randomly drops messages (3)
  • HELICS_FILTER_TYPE_REROUTE: a filter type that reroutes a message to a different destination than originally specified (4)
  • HELICS_FILTER_TYPE_CLONE: a filter type that duplicates a message and sends the copy to a different destination (5)
  • HELICS_FILTER_TYPE_FIREWALL: a customizable filter type that can perform different actions on a message based on firewall like rules (6)
source
HELICS.HELICS_HANDLE_OPTIONSType

Enumeration of options that apply to handles

  • HELICS_HANDLE_OPTION_CONNECTION_REQUIRED: specify that a connection is required for an interface and will generate an error if not available (397)
  • HELICS_HANDLE_OPTION_CONNECTION_OPTIONAL: specify that a connection is NOT required for an interface and will only be made if available no warning will be issues if not available (402)
  • HELICS_HANDLE_OPTION_SINGLE_CONNECTION_ONLY: specify that only a single connection is allowed for an interface (407)
  • HELICS_HANDLE_OPTION_MULTIPLE_CONNECTIONS_ALLOWED: specify that multiple connections are allowed for an interface (409)
  • HELICS_HANDLE_OPTION_BUFFER_DATA: specify that the last data should be buffered and send on subscriptions after init (411)
  • HELICS_HANDLE_OPTION_STRICT_TYPE_CHECKING: specify that the types should be checked strictly for pub/sub and filters (414)
  • HELICS_HANDLE_OPTION_IGNORE_UNIT_MISMATCH: specify that the mismatching units should be ignored (447)
  • HELICS_HANDLE_OPTION_ONLY_TRANSMIT_ON_CHANGE: specify that an interface will only transmit on change (only applicable to publications) (6)
  • HELICS_HANDLE_OPTION_ONLY_UPDATE_ON_CHANGE: specify that an interface will only update if the value has actually changed (8)
  • HELICS_HANDLE_OPTION_IGNORE_INTERRUPTS: specify that an interface does not participate in determining time interrupts (475)
source
HELICS.HELICS_ITERATION_REQUESTType

Enumeration of the different iteration results

  • HELICS_ITERATION_REQUEST_NO_ITERATION: No iteration is requested (0)
  • HELICS_ITERATION_REQUEST_FORCE_ITERATION: Force iteration return when able (1)
  • HELICS_ITERATION_REQUEST_ITERATE_IF_NEEDED: Only return an iteration if necessary (2)
source
HELICS.HELICS_ITERATION_RESULTType

Enumeration of possible return values from an iterative time request

  • HELICS_ITERATION_RESULT_NEXT_STEP: the iterations have progressed to the next time (0)
  • HELICS_ITERATION_RESULT_ERROR: there was an error (1)
  • HELICS_ITERATION_RESULT_HALTED: the federation has halted (2)
  • HELICS_ITERATION_RESULT_ITERATING: the federate is iterating at current time (3)
source
HELICS.HELICS_LOG_LEVELSType

Log level definitions

  • HELICS_LOG_LEVEL_NO_PRINT: don't print anything except a few catastrophic errors (-1)
  • HELICS_LOG_LEVEL_ERROR: only print error level indicators (0)
  • HELICS_LOG_LEVEL_WARNING: only print warnings and errors (1)
  • HELICS_LOG_LEVEL_SUMMARY: warning errors and summary level information (2)
  • HELICS_LOG_LEVEL_CONNECTIONS: summary+ notices about federate and broker connections +messages about network connections (3)
  • HELICS_LOG_LEVEL_INTERFACES: connections+ interface definitions (4)
  • HELICS_LOG_LEVEL_TIMING: interfaces + timing message (5)
  • HELICS_LOG_LEVEL_DATA: timing+ data transfer notices (6)
  • HELICS_LOG_LEVEL_TRACE: all internal messages (7)
source
HELICS.HELICS_PROPERTIESType

Enumeration of properties that apply to federates

  • HELICS_PROPERTY_TIME_DELTA: the property controlling the minimum time delta for a federate (137)
  • HELICS_PROPERTY_TIME_PERIOD: the property controlling the period for a federate (140)
  • HELICS_PROPERTY_TIME_OFFSET: the property controlling time offset for the period of federate (141)
  • HELICS_PROPERTY_TIME_RT_LAG: the property controlling real time lag for a federate the max time a federate can lag real time (143)
  • HELICS_PROPERTY_TIME_RT_LEAD: the property controlling real time lead for a federate the max time a federate can be ahead of real time (144)
  • HELICS_PROPERTY_TIME_RT_TOLERANCE: the property controlling real time tolerance for a federate sets both HELICS_PROPERTY_RT_LAG and HELICS_PROPERTY_RT_LEAD (145)
  • HELICS_PROPERTY_TIME_INPUT_DELAY: the property controlling input delay for a federate (148)
  • HELICS_PROPERTY_TIME_OUTPUT_DELAY: the property controlling output delay for a federate (150)
  • HELICS_PROPERTY_INT_MAX_ITERATIONS: integer property controlling the maximum number of iterations in a federate (259)
  • HELICS_PROPERTY_INT_LOG_LEVEL: integer property controlling the log level in a federate see HELICS_LOG_LEVELS (271)
  • HELICS_PROPERTY_INT_FILE_LOG_LEVEL: integer property controlling the log level for file logging in a federate see HELICS_LOG_LEVELS (272)
  • HELICS_PROPERTY_INT_CONSOLE_LOG_LEVEL: integer property controlling the log level for file logging in a federate see HELICS_LOG_LEVELS (274)
source

Functions

  1. Broker
  2. Core
  3. Endpoint
  4. FederateInfo
  5. Federate
  6. Filter
  7. Input
  8. Message
  9. Publication
  10. Query

Broker

HELICS.helicsBrokerAddDestinationFilterToEndpointMethod
helicsBrokerAddDestinationFilterToEndpoint(broker::HELICS.Broker, filter::String, endpoint::String)

Link a named filter to a destination endpoint

Arguments

  • broker the Broker to generate the connection from
  • filter the name of the Filter (cannot be NULL)
  • endpoint the name of the Endpoint to filter the data going to (cannot be NULL)
source
HELICS.helicsBrokerAddSourceFilterToEndpointMethod
helicsBrokerAddSourceFilterToEndpoint(broker::HELICS.Broker, filter::String, endpoint::String)

Link a named filter to a source endpoint

Arguments

  • broker the Broker to generate the connection from
  • filter the name of the Filter (cannot be NULL)
  • endpoint the name of the Endpoint to filter the data from (cannot be NULL)
source
HELICS.helicsBrokerCloneMethod
helicsBrokerClone(broker::HELICS.Broker) -> HELICS.Broker

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

Arguments

Returns

  • a new reference to the same broker
source
HELICS.helicsBrokerDataLinkMethod
helicsBrokerDataLink(broker::HELICS.Broker, source::String, target::String)

Link a named publication and named input using a broker

Arguments

  • broker: the Broker to generate the connection from
  • source: the name of the Publication (cannot be NULL)
  • target: the name of the target to send the Publication data (cannot be NULL)
source
HELICS.helicsBrokerGetAddressMethod
helicsBrokerGetAddress(broker::HELICS.Broker) -> String

Get the network address associated with a broker

Arguments

Returns

  • a string with the network address of the Broker
source
HELICS.helicsBrokerIsConnectedMethod
helicsBrokerIsConnected(broker::HELICS.Broker) -> Bool

Check if a broker is connected. A connected broker implies is attached to cores or cores could reach out to communicate. return 0 if not connected , something else if it is connected.

source
HELICS.helicsBrokerMakeConnectionsMethod
helicsBrokerMakeConnections(broker::HELICS.Broker, file::String)

Load a file containing connection information

Arguments

  • broker: the Broker to generate the connections from
  • file: A JSON or TOML file containing connection information
source
HELICS.helicsBrokerSetGlobalMethod
helicsBrokerSetGlobal(broker::HELICS.Broker, valueName::String, value::String)

Set a federation global value

this overwrites any previous value for this name

Arguments

  • broker: the Broker to set the global through
  • valueName: the name of the global to set
  • value: the value of the global
source
HELICS.helicsBrokerSetLogFileMethod
helicsBrokerSetLogFile(broker::HELICS.Broker, logFileName::String)

Set a the log file on a broker

Arguments

  • broker: the Broker to set the global through
  • logFileName: The name of the file to log to
source
HELICS.helicsBrokerSetLoggingCallbackMethod
helicsBrokerSetLoggingCallback(broker::HELICS.Broker, logger::Ptr{Nothing}, userdata::Any)

Set the logging callback to a broker

Add a logging callback function for the C The logging callback will be called when a message flows into a broker from the core or from a broker

Arguments

  • broker: the Broker object in which to create a Subscription must have been create with helicsCreateValueFederate or helicsCreateCombinationFederate
  • logger: a callback with signature void(int, const char *, const char *, void *); the function arguments are loglevel, an identifier, and a message string, and a pointer to user data
  • userdata: a point to user data that is passed to the function when executing
source
HELICS.helicsBrokerWaitForDisconnectMethod
helicsBrokerWaitForDisconnect(broker::HELICS.Broker, msToWait::Int64) -> Bool

Wait for the Broker to disconnect

Arguments

  • broker: the Broker to wait for
  • msToWait: the time out in millisecond (<0 for infinite timeout)

Returns

  • true if the disconnect was successful, false if there was a timeout
source

Core

HELICS.helicsCoreAddSourceFilterToEndpointMethod
helicsCoreAddSourceFilterToEndpoint(core::HELICS.Core, filter::String, endpoint::String)

Link a named filter to a source endpoint

Arguments

  • core: the core to generate the connection from
  • filter: the name of the Filter (cannot be NULL)
  • endpoint: the name of the Endpoint to filter the data from (cannot be NULL)
source
HELICS.helicsCoreCloneMethod
helicsCoreClone(core::HELICS.Core) -> HELICS.Core

Create a new reference to an existing core

this will create a new broker object that references the existing broker it must be freed as well

Arguments

  • core: an existing Core

Returns

  • a new reference to the same Core
source
HELICS.helicsCoreDataLinkMethod
helicsCoreDataLink(core::HELICS.Core, source::String, target::String)

Link a named publication and named input using a core

Arguments

  • core: the core to generate the connection from
  • source: the name of the Publication (cannot be NULL)
  • target: the named of the target to send the Publication data (cannot be NULL)
source
HELICS.helicsCoreDisconnectMethod
helicsCoreDisconnect(core::HELICS.Core)

Get an identifier for the core

Arguments

  • core: the core to query

Returns

  • a void enumeration indicating any error condition
source
HELICS.helicsCoreGetAddressMethod
helicsCoreGetAddress(core::HELICS.Core) -> String

Get the network address associated with a core

Arguments

  • core: The core to query

Returns

  • a string with the network address of the Broker
source
HELICS.helicsCoreGetIdentifierMethod
helicsCoreGetIdentifier(core::HELICS.Core) -> String

Get an identifier for the core

Arguments

  • core: the core to query

Returns

  • a string with the identifier of the core
source
HELICS.helicsCoreIsConnectedMethod
helicsCoreIsConnected(core::HELICS.Core) -> Bool

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

Returns

  • false if not connected, true if it is connected
source
HELICS.helicsCoreMakeConnectionsMethod
helicsCoreMakeConnections(core::HELICS.Core, file::String)

Load a file containing connection information

Arguments

  • core: The core to generate the connections from
  • file: A JSON or TOML file containing connection information
source
HELICS.helicsCoreRegisterCloningFilterMethod
helicsCoreRegisterCloningFilter(core::HELICS.Core, name::String) -> HELICS.Filter

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

Arguments

  • core: the core to register through
  • name: the name of the Filter (can be NULL)

Returns

source
HELICS.helicsCoreRegisterFilterMethod
helicsCoreRegisterFilter(core::HELICS.Core, kind::Union{Int64, HELICS.Lib.helics_filter_type}, name::String) -> HELICS.Filter

Create a source Filter on the specified core

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

Arguments

  • core the core to register through
  • type the type of filter to create HELICS_FILTER_TYPE
  • name the name of the Filter (can be NULL)

Returns

source
HELICS.helicsCoreSetGlobalMethod
helicsCoreSetGlobal(core::HELICS.Core, valueName::String, value::String)

Set a global value in a core

this overwrites any previous value for this name

Arguments

  • core: the core to set the global through
  • valueName: the name of the global to set
  • value: the value of the global
source
HELICS.helicsCoreSetLogFileMethod
helicsCoreSetLogFile(core::HELICS.Core, logFileName::String)

Set a the log file on a core

Arguments

  • core: The core to set the global through
  • logFileName: The name of the file to log to
source
HELICS.helicsCoreSetLoggingCallbackMethod
helicsCoreSetLoggingCallback(core::HELICS.Core, logger::Ptr{Nothing}, userdata::Any)

Set the logging callback for a core

Add a logging callback function for the C The logging callback will be called when a message flows into a core from the core or from a broker

Arguments

  • core: the core object in which to create a Subscription must have been create with helicsCreateValueFederate or helicsCreateCombinationFederate
  • logger: a callback with signature void(int, const char *, const char *, void *); the function arguments are loglevel, an identifier, and a message string
  • userdata: a point to user data that is passed to the function when executing
source
HELICS.helicsCoreSetReadyToInitMethod
helicsCoreSetReadyToInit(core::HELICS.Core)

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

Arguments

  • core: the core object to enable init values for
source
HELICS.helicsCoreWaitForDisconnectMethod
helicsCoreWaitForDisconnect(core::HELICS.Core, msWait::Int64) -> Int32

Wait for the core to disconnect

Arguments

  • core: The core to wait for
  • msToWait: The time out in millisecond (<0 for infinite timeout)

Returns

true if the disconnect was successful, false if there was a timeout

source

Endpoint

HELICS.helicsEndpointGetInfoMethod
helicsEndpointGetInfo(_end::HELICS.Endpoint) -> String

Get the data in the info field of an filter

Arguments

Returns

  • a string with the info field string
source
HELICS.helicsEndpointSendEventRawMethod
helicsEndpointSendEventRaw(endpoint::HELICS.Endpoint, dest::String, data::String, time::Union{Float64, Int64})

Send a message at a specific time to the specified destination

Arguments

  • endpoint: The Endpoint to send the data from
  • dest: The target destination (empty string to use the default destination)
  • data: The data to send
  • time: The time the message should be sent
source
HELICS.helicsEndpointSendMessageRawMethod
helicsEndpointSendMessageRaw(endpoint::HELICS.Endpoint, dest::String, data::String)

Send a message to the specified destination

Arguments

  • endpoint: The Endpoint to send the data from
  • dest: The target destination (empty string to use the default destination)
  • data: The data to send
source

Federate

HELICS.helicsFederateCloneMethod
helicsFederateClone(fed::T<:HELICS.Federate) -> Union{HELICS.CombinationFederate, HELICS.MessageFederate, HELICS.ValueFederate}

Create a new reference to an existing federate

this will create a new Federate object that references the existing federate it must be freed as well

Arguments

Returns

  • a new reference to the same federate
source
HELICS.helicsFederateCreateMessageObjectMethod
helicsFederateCreateMessageObject(fed::HELICS.Federate) -> HELICS.Message

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.

Returns

  • a Message containing the message data
source
HELICS.helicsFederateEnterExecutingModeIterativeMethod
helicsFederateEnterExecutingModeIterative(fed::HELICS.Federate, iterate::Union{Int64, HELICS.Lib.helics_iteration_request}) -> HELICS.Lib.helics_iteration_result

Request an iterative time

this call allows for finer grain control of the iterative process then helicsFederateRequestTime it takes a time and iteration request and return a time and iteration status.

Arguments

  • fed: the Federate to make the request of
  • iterate: the requested iteration mode

Returns

  • an iteration structure with field containing the time and iteration status
source
HELICS.helicsFederateEnterExecutingModeIterativeAsyncMethod
helicsFederateEnterExecutingModeIterativeAsync(fed::HELICS.Federate, iterate::Union{Int64, HELICS.Lib.helics_iteration_request})

Request an iterative entry to the execution mode

This call allows for finer grain control of the iterative process then helicsFederateRequestTime it takes a time and and iteration request and return a time and iteration status

Arguments

  • fed: the Federate to make the request of
  • iterate: the requested iteration mode
source
HELICS.helicsFederateEnterExecutingModeIterativeCompleteMethod
helicsFederateEnterExecutingModeIterativeComplete(fed::HELICS.Federate) -> HELICS.Lib.helics_iteration_result

Complete the asynchronous iterative call into ExecutionModel

Arguments

  • fed: the Federate to make the request of

Returns

  • an iteration object containing the iteration time and iteration_status
source
HELICS.helicsFederateEnterInitializingModeMethod
helicsFederateEnterInitializingMode(fed::HELICS.Federate)

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.

Arguments

source
HELICS.helicsFederateGetFilterMethod
helicsFederateGetFilter(fed::HELICS.Federate, name::String) -> HELICS.Filter

Get a Filter by its name typically already created via helicsFederateRegisterInterfaces file or something of that nature

Arguments

Returns

  • a Filter object, the object will not be valid and err will contain an error code if no filter with the specified name exists
source
HELICS.helicsFederateGetFlagOptionMethod
helicsFederateGetFlagOption(fed::HELICS.Federate, flag::Union{Int64, HELICS.Lib.helics_federate_flags, HELICS.Lib.helics_handle_options}) -> Bool

Get a flag value for a Federate

Arguments

  • fed: the Federate to get the flag for
  • flag: the flag to query

Returns

  • the value of the flag
source
HELICS.helicsFederateGetInputMethod
helicsFederateGetInput(fed::HELICS.Federate, key::String) -> HELICS.Subscription

Get an Input object from a key

Arguments

  • fed: the value federate object to use to get the Publication
  • key: the name of the Input

Returns

  • a Subscription object, the object will not be valid and err will contain an error code if no input with the specified key exists
source
HELICS.helicsFederateGetInputByIndexMethod
helicsFederateGetInputByIndex(fed::HELICS.Federate, index::Int64) -> HELICS.Subscription

Get an Input by its index typically already created via helicsFederateRegisterInterfaces file or something of that nature

Arguments

Returns

  • a helics_input, which will be NULL if an invalid index
source
HELICS.helicsFederateGetIntegerPropertyMethod
helicsFederateGetIntegerProperty(fed::HELICS.Federate, intProperty::Union{Int64, HELICS.Lib.helics_handle_options, HELICS.Lib.helics_properties}) -> Int64

Set the logging level for the Federate

debug and trace only do anything if they were enabled in the compilation

Arguments

Returns

  • the value of the property
source
HELICS.helicsFederateGetMessageMethod
helicsFederateGetMessage(fed::HELICS.Federate) -> HELICS.Lib.helics_message

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, then all for the second, and so on within a single endpoint the messages are ordered by time, then source_id, then order of arrival

Returns

source
HELICS.helicsFederateGetMessageObjectMethod
helicsFederateGetMessageObject(fed::HELICS.Federate) -> HELICS.Message

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, then all for the second, and so on within a single endpoint the messages are ordered by time, then source_id, then order of arrival

Returns

data in the message

source
HELICS.helicsFederateGetTimePropertyMethod
helicsFederateGetTimeProperty(fed::HELICS.Federate, timeProperty::Union{Int64, HELICS.Lib.helics_properties}) -> Float64

Get the current value of a time based property in a Federate

Arguments

  • fed: the Federate query
  • timeProperty: the property to query
source
HELICS.helicsFederateGlobalErrorMethod
helicsFederateGlobalError(fed::HELICS.Federate, error_code::Integer, error_string::String)

Generate a global Error from a Federate

A global error halts the co-simulation completely

Arguments

  • fed: the Federate to create an error in
  • error_code: the integer code for the error
  • error_string: a string describing the error
source
HELICS.helicsFederateLocalErrorMethod
helicsFederateLocalError(fed::HELICS.Federate, error_code::Integer, error_string::String)

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.

Arguments

  • fed: the Federate to create an error in
  • error_code: the integer code for the error
  • error_string: a string describing the error
source
HELICS.helicsFederatePendingMessagesMethod
helicsFederatePendingMessages(fed::HELICS.Federate) -> Int64

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

Arguments

  • fed: The Federate to get the number of waiting messages
source
HELICS.helicsFederateRegisterCloningFilterMethod
helicsFederateRegisterCloningFilter(fed::HELICS.Federate, name::String) -> HELICS.Filter

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

Arguments

  • fed: the fed to register through
  • name: the name of the Filter (can be NULL)

Returns

source
HELICS.helicsFederateRegisterEndpointMethod
helicsFederateRegisterEndpoint(fed::HELICS.Federate, name::String, kind::String) -> HELICS.Endpoint

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.

Arguments

Returns

source
HELICS.helicsFederateRegisterFilterMethod
helicsFederateRegisterFilter(fed::HELICS.Federate, kind::Union{Int64, HELICS.Lib.helics_filter_type}, name::String) -> HELICS.Filter

Create a source 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

Arguments

  • fed: the fed to register through
  • type: the type of filter to create HELICS_FILTER_TYPE
  • name: the name of the Filter (can be NULL)

Returns

source
HELICS.helicsFederateRegisterGlobalCloningFilterMethod
helicsFederateRegisterGlobalCloningFilter(fed::HELICS.Federate, name::String) -> HELICS.Filter

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

Arguments

  • fed: the fed to register through
  • name: the name of the Filter (can be NULL)

Returns

source
HELICS.helicsFederateRegisterGlobalEndpointMethod
helicsFederateRegisterGlobalEndpoint(fed::HELICS.Federate, name::String, kind::String) -> HELICS.Endpoint

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

Arguments

Returns

source
HELICS.helicsFederateRegisterGlobalFilterMethod
helicsFederateRegisterGlobalFilter(fed::HELICS.Federate, kind::Union{Int64, HELICS.Lib.helics_filter_type}, name::String) -> HELICS.Filter

Create a global source filter through a 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

Arguments

  • fed: the fed to register through
  • type: the type of filter to create HELICS_FILTER_TYPE
  • name: the name of the Filter (can be NULL)

Returns

source
HELICS.helicsFederateRegisterGlobalInputFunction
helicsFederateRegisterGlobalInput(fed::HELICS.Federate, key::String, kind::Union{Int64, HELICS.Lib.helics_data_type}) -> HELICS.Subscription
helicsFederateRegisterGlobalInput(fed::HELICS.Federate, key::String, kind::Union{Int64, HELICS.Lib.helics_data_type}, units::String) -> HELICS.Subscription

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

Arguments

Returns

source
HELICS.helicsFederateRegisterGlobalPublicationFunction
helicsFederateRegisterGlobalPublication(fed::HELICS.Federate, key::String, kind::Union{Int64, HELICS.Lib.helics_data_type}) -> HELICS.Publication
helicsFederateRegisterGlobalPublication(fed::HELICS.Federate, key::String, kind::Union{Int64, HELICS.Lib.helics_data_type}, units::String) -> HELICS.Publication

Register a global named publication with an arbitrary type

Arguments

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

Arguments

Returns

source
HELICS.helicsFederateRegisterGlobalTypeInputFunction
helicsFederateRegisterGlobalTypeInput(fed::HELICS.Federate, key::String, kind::String) -> HELICS.Subscription
helicsFederateRegisterGlobalTypeInput(fed::HELICS.Federate, key::String, kind::String, units::String) -> HELICS.Subscription

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

Arguments

Returns

source
HELICS.helicsFederateRegisterGlobalTypePublicationFunction
helicsFederateRegisterGlobalTypePublication(fed::HELICS.Federate, key::String, kind::String) -> HELICS.Publication
helicsFederateRegisterGlobalTypePublication(fed::HELICS.Federate, key::String, kind::String, units::String) -> HELICS.Publication

Register a global publication with a defined type

Arguments

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

Returns

source
HELICS.helicsFederateRegisterInputFunction
helicsFederateRegisterInput(fed::HELICS.Federate, key::String, kind::Union{Int64, HELICS.Lib.helics_data_type}) -> HELICS.Subscription
helicsFederateRegisterInput(fed::HELICS.Federate, key::String, kind::Union{Int64, HELICS.Lib.helics_data_type}, units::String) -> HELICS.Subscription

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

Arguments

  • fed: the Federate in which to create an Input
  • key: the identifier for the Publication the global input key will be prepended with the Federate name
  • type: a code identifying the type of the Input see HELICS_DATA_TYPE for available options
  • units: a string listing the units of the Input maybe NULL

Returns

source
HELICS.helicsFederateRegisterInterfacesMethod
helicsFederateRegisterInterfaces(fed::HELICS.Federate, file::String)

Load interfaces from a file

Arguments

  • fed: the Federate to which to load interfaces
  • file: the name of a file to load the interfaces from either JSON, or TOML
source
HELICS.helicsFederateRegisterPublicationFunction
helicsFederateRegisterPublication(fed::HELICS.Federate, key::String, kind::Union{Int64, HELICS.Lib.helics_data_type}) -> HELICS.Publication
helicsFederateRegisterPublication(fed::HELICS.Federate, key::String, kind::Union{Int64, HELICS.Lib.helics_data_type}, units::String) -> HELICS.Publication

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

Arguments

Returns

source
HELICS.helicsFederateRegisterSubscriptionFunction
helicsFederateRegisterSubscription(fed::HELICS.Federate, key::String) -> HELICS.Subscription
helicsFederateRegisterSubscription(fed::HELICS.Federate, key::String, units::String) -> HELICS.Subscription

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

Arguments

Returns

source
HELICS.helicsFederateRegisterTypeInputFunction
helicsFederateRegisterTypeInput(fed::HELICS.Federate, key::String, kind::String) -> HELICS.Subscription
helicsFederateRegisterTypeInput(fed::HELICS.Federate, key::String, kind::String, units::String) -> HELICS.Subscription

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

Arguments

  • fed: the Federate in which to create an Input
  • key: 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

source
HELICS.helicsFederateRegisterTypePublicationFunction
helicsFederateRegisterTypePublication(fed::HELICS.Federate, key::String, kind::String) -> HELICS.Publication
helicsFederateRegisterTypePublication(fed::HELICS.Federate, key::String, kind::String, units::String) -> HELICS.Publication

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

Arguments

Returns

source
HELICS.helicsFederateRequestNextStepMethod
helicsFederateRequestNextStep(fed::HELICS.Federate) -> Float64

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.

Arguments

  • fed: the Federate to make the request of

Returns

source
HELICS.helicsFederateRequestTimeMethod
helicsFederateRequestTime(fed::HELICS.Federate, requestTime::Union{Float64, Int64}) -> Float64

Request the next time for federate execution

Arguments

  • fed: the Federate to make the request of
  • requestTime: the next requested time

Returns

  • the time granted to the Federate invalid
source
HELICS.helicsFederateRequestTimeAdvanceMethod
helicsFederateRequestTimeAdvance(fed::HELICS.Federate, timeDelta::Union{Float64, Int64}) -> Float64

Request the next time for federate execution

Arguments

  • fed: The Federate to make the request of
  • timeDelta: The requested amount of time to advance

Returns

  • the time granted to the Federate, will return maximum time if the simulation has terminated invalid
source
HELICS.helicsFederateRequestTimeIterativeMethod
helicsFederateRequestTimeIterative(fed::HELICS.Federate, requestTime::Union{Float64, Int64}, iterate::Union{Int64, HELICS.Lib.helics_iteration_request}) -> Tuple{Float64,HELICS.Lib.helics_iteration_result}

Request an iterative time

this call allows for finer grain control of the iterative process then helicsFederateRequestTime it takes a time and iteration request and return a time and iteration status.

Arguments

  • fed: the Federate to make the request of
  • requestTime: the next desired time
  • iterate: the requested iteration mode

Returns

  • the granted time
  • the iteration specification of the result
source
HELICS.helicsFederateRequestTimeIterativeAsyncMethod
helicsFederateRequestTimeIterativeAsync(fed::HELICS.Federate, requestTime::Union{Float64, Int64}, iterate::Union{Int64, HELICS.Lib.helics_iteration_request})

Request an iterative time through an asynchronous call

this call allows for finer grain control of the iterative process then helicsFederateRequestTime it takes a time an iteration request and returns a time and iteration status call helicsFederateRequestTimeIterativeComplete to finish the process.

Arguments

  • fed: the Federate to make the request of
  • requestTime: the next desired time
  • iterate: the requested iteration mode

Returns

  • a void object with a return code of the result
source
HELICS.helicsFederateRequestTimeIterativeCompleteMethod
helicsFederateRequestTimeIterativeComplete(fed::HELICS.Federate) -> Tuple{Float64,HELICS.Lib.helics_iteration_result}

Complete an iterative time request asynchronous call

Arguments

  • fed: the Federate to make the request of

Returns

  • the granted time
  • outIterate the iteration specification of the result
source
HELICS.helicsFederateSetFlagOptionMethod
helicsFederateSetFlagOption(fed::HELICS.Federate, flag::Union{Int64, HELICS.Lib.helics_federate_flags, HELICS.Lib.helics_handle_options}, flagValue::Bool)

Set a flag for the Federate

Arguments

  • fed: the Federate to alter a flag for
  • flag: the flag to change
  • flagValue: the new value of the flag 0 for false !=0 for true
source
HELICS.helicsFederateSetGlobalMethod
helicsFederateSetGlobal(fed::HELICS.Federate, valueName::String, value::String)

Set a federation global value through a Federate

this overwrites any previous value for this name

Arguments

  • fed: the Federate to set the global through
  • valueName: the name of the global to set
  • value: the value of the global
source
HELICS.helicsFederateSetIntegerPropertyMethod
helicsFederateSetIntegerProperty(fed::HELICS.Federate, intProperty::Union{Int64, HELICS.Lib.helics_properties}, propertyVal::Int64)

Set an integer based property of a Federate

Arguments

  • fed: the Federate to change the property for
  • intProperty: the property to set
  • propertyVal: the value of the property
source
HELICS.helicsFederateSetLogFileMethod
helicsFederateSetLogFile(fed::HELICS.Federate, logFile::String)

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

Arguments

  • fed: the Federate to set the log file for
  • logFile: the name of the log file
source
HELICS.helicsFederateSetLoggingCallbackMethod
helicsFederateSetLoggingCallback(fed::HELICS.Federate, logger::Ptr{Nothing}, userdata::Any)

Set the logging callback for a Federate

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

Arguments

  • fed: the Federate in which to create a Subscription must have been create with helicsCreateValueFederate or 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
  • userdata: a point to user data that is passed to the function when executing
source
HELICS.helicsFederateSetSeparatorMethod
helicsFederateSetSeparator(fed::HELICS.Federate, separator::Char)

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.

Arguments

  • fed: the Federate object to alter
  • separator: the character to use as a separator
source
HELICS.helicsFederateSetTimePropertyMethod
helicsFederateSetTimeProperty(fed::HELICS.Federate, timeProperty::Union{Int64, HELICS.Lib.helics_properties}, time::Union{Float64, Int64})

Set a time based property for a Federate

Arguments

  • fed: the Federate set the property for
  • timeProperty: a integer code for a time property
  • time: the requested value of the property
source

FederateInfo

HELICS.helicsFederateInfoSetBrokerMethod
helicsFederateInfoSetBroker(fi::HELICS.FederateInfo, broker::String)

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

Arguments

  • fi: the FederateInfo object to alter
  • broker: a string which defined the connection information for a broker either a name or an address
source
HELICS.helicsFederateInfoSetBrokerInitStringMethod
helicsFederateInfoSetBrokerInitString(fi::HELICS.FederateInfo, brokerInit::String)

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

Arguments

  • fi: The Federate info object to alter
  • brokerInit: A string with command line arguments for a generated broker
source
HELICS.helicsFederateInfoSetBrokerKeyMethod
helicsFederateInfoSetBrokerKey(fi::HELICS.FederateInfo, brokerKey::String)

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

Arguments

  • fi: The Federate info object to alter
  • brokerkey: A string containing a key for the Broker to connect
source
HELICS.helicsFederateInfoSetBrokerPortMethod
helicsFederateInfoSetBrokerPort(fi::HELICS.FederateInfo, brokerPort::Int64)

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

Arguments

  • fi: the FederateInfo object to alter
  • brokerPort: the integer port number to use for connection with a broker
source
HELICS.helicsFederateInfoSetCoreInitStringMethod
helicsFederateInfoSetCoreInitString(fi::HELICS.FederateInfo, coreInit::String)

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

Arguments

  • fi: the FederateInfo object to alter
  • coreInit: a string with the core initialization strings
source
HELICS.helicsFederateInfoSetCoreTypeMethod
helicsFederateInfoSetCoreType(fi::HELICS.FederateInfo, coretype::Union{Int64, HELICS.Lib.helics_core_type})

Set the core type by integer code

valid values available by definitions in api-data.h

Arguments

  • fi: the FederateInfo object to alter
  • coretype: an numerical code for a core type see /ref helicscoretype
source
HELICS.helicsFederateInfoSetFlagOptionMethod
helicsFederateInfoSetFlagOption(fi::HELICS.FederateInfo, flag::Union{Int64, HELICS.Lib.helics_federate_flags}, value::Bool)

Set a flag in the info structure

valid flags are available HELICS_FEDERATE_FLAGS

Arguments

  • fi: the FederateInfo object to alter
  • flag: a numerical index for a flag
  • value: the desired value of the flag true or false
source
HELICS.helicsFederateInfoSetLocalPortMethod
helicsFederateInfoSetLocalPort(fi::HELICS.FederateInfo, localPort::String)

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

Arguments

  • fi: the FederateInfo object to alter
  • localPort: a string with the port information to use as the local server port can be a number or "auto" or "os_local"
source
HELICS.helicsFederateInfoSetSeparatorMethod
helicsFederateInfoSetSeparator(fi::HELICS.FederateInfo, separator::Char)

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

Arguments

  • fi: the FederateInfo object to alter
  • separator: the character to use as a separator
source

Filter

HELICS.helicsFilterAddDeliveryEndpointMethod
helicsFilterAddDeliveryEndpoint(filt::HELICS.Filter, deliveryEndpoint::String)

Add a delivery endpoint to a cloning filter

All cloned messages are sent to the delivery address(es)

Arguments

  • filt: the given Filter
  • deliveryEndpoint: the name of the Endpoint to deliver messages to
source
HELICS.helicsFilterAddDestinationTargetMethod
helicsFilterAddDestinationTarget(filt::HELICS.Filter, dest::String)

Add a destination target to a Filter

All messages going to a destination are copied to the delivery address(es)

Arguments

  • filt: the given Filter to add a destination target
  • dest: the name of the Endpoint to add as a destination target
source
HELICS.helicsFilterGetInfoMethod
helicsFilterGetInfo(filt::HELICS.Filter) -> String

Get the data in the info field of an filter

Arguments

Returns

  • a string with the info field string
source
HELICS.helicsFilterRemoveDeliveryEndpointMethod
helicsFilterRemoveDeliveryEndpoint(filt::HELICS.Filter, deliveryEndpoint::String)

Remove a delivery destination from a cloning filter

Arguments

  • filt: the given Filter (must be a cloning filter)
  • deliveryEndpoint: a string with the deliverEndpoint to remove
source
HELICS.helicsFilterSetMethod
helicsFilterSet(filt::HELICS.Filter, prop::String, val::Float64)

Set a property on a Filter

Arguments

  • filt: the Filter to modify
  • prop: a string containing the property to set
  • val: a numerical value of the property
source
HELICS.helicsFilterSetInfoMethod
helicsFilterSetInfo(filt::HELICS.Filter, info::String)

Set the data in the info field for an filter

Arguments

  • filt: the given Filter
  • info: the string to set
source
HELICS.helicsFilterSetOptionMethod
helicsFilterSetOption(filt::HELICS.Filter, option::Union{Int64, HELICS.Lib.helics_handle_options}, value::Bool)

Set the data in the info field for an filter

Arguments

source
HELICS.helicsFilterSetStringMethod
helicsFilterSetString(filt::HELICS.Filter, prop::String, val::String)

Set a string property on a Filter

Arguments

  • filt: the Filter to modify
  • prop: a string containing the property to set
  • val: a string containing the new value
source

Input

HELICS.helicsInputGetCharMethod
helicsInputGetChar(ipt::HELICS.Subscription) -> Char

Get a single character value from an Input

Arguments

  • ipt: the Input to get the data for

Returns

  • the resulting character value
source
HELICS.helicsInputGetExtractionUnitsMethod
helicsInputGetExtractionUnits(ipt::HELICS.Subscription) -> String

Get the units of an Input

The same as helicsInputGetUnits

Arguments

Returns

  • a void enumeration, helics_ok if everything worked
source
HELICS.helicsInputGetInfoMethod
helicsInputGetInfo(inp::HELICS.Subscription) -> String

Get the data in the info field of an Input

Arguments

Returns

  • a string with the info field string
source
HELICS.helicsInputGetKeyMethod
helicsInputGetKey(ipt::HELICS.Subscription) -> String

Get the key of an Input

Arguments

Returns

  • a void enumeration, helics_ok if everything worked
source
HELICS.helicsInputGetNamedPointMethod
helicsInputGetNamedPoint(ipt::HELICS.Subscription) -> Tuple{String,Float64}

Get a named point from a Subscription

Arguments

  • ipt: the Input to get the result for

Returns

  • outputString storage for copying a null terminated string
  • val the double value for the named point
source
HELICS.helicsInputGetOptionMethod
helicsInputGetOption(inp::HELICS.Subscription, option::Union{Int64, HELICS.Lib.helics_handle_options}) -> Bool

Get the data in the info field of an Input

Arguments

Returns

  • a string with the info field string
source
HELICS.helicsInputGetRawValueSizeMethod
helicsInputGetRawValueSize(ipt::HELICS.Subscription) -> Int64

Get the size of the raw value for subscription

Returns

  • the size of the raw data/string in bytes
source
HELICS.helicsInputGetStringSizeMethod
helicsInputGetStringSize(ipt::HELICS.Subscription) -> Int64

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

Returns

  • the size of the string
source
HELICS.helicsInputGetTypeMethod
helicsInputGetType(ipt::HELICS.Subscription) -> String

Get the type of an Input

Arguments

Returns

  • a void enumeration, helics_ok if everything worked
source
HELICS.helicsInputGetUnitsMethod
helicsInputGetUnits(ipt::HELICS.Subscription) -> String

Get the units of an Input

Arguments

Returns

  • a void enumeration, helics_ok if everything worked
source
HELICS.helicsInputGetVectorSizeMethod
helicsInputGetVectorSize(ipt::HELICS.Subscription) -> Int64

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

Returns

  • the number of double in a return vector
source
HELICS.helicsInputIsUpdatedMethod
helicsInputIsUpdated(ipt::HELICS.Subscription) -> Bool

Check if a particular subscription was updated

Arguments

Returns

  • true if it has been updated since the last value retrieval
source
HELICS.helicsInputSetDefaultComplexMethod
helicsInputSetDefaultComplex(ipt::HELICS.Subscription, c::Complex{Float64})

Set the default as a complex number

Arguments

  • ipt: the Input to set the default for
  • c: the default ComplexF64
source
HELICS.helicsInputSetDefaultNamedPointMethod
helicsInputSetDefaultNamedPoint(ipt::HELICS.Subscription, str::String, val::Float64)

Set the default as a NamedPoint

Arguments

  • ipt: the Input to set the default for
  • str: a pointer to a string representing the name
  • val: a double value for the value of the named point
source
HELICS.helicsInputSetDefaultRawMethod
helicsInputSetDefaultRaw(ipt::HELICS.Subscription, data::Any)

Set the default as a raw data array

Arguments

  • ipt: the Input to set the default for
  • data: a pointer to the raw data to use for the default
source
HELICS.helicsInputSetDefaultStringMethod
helicsInputSetDefaultString(ipt::HELICS.Subscription, str::String)

Set the default as a string

Arguments

  • ipt: the Input to set the default for
  • str: a pointer to the default string
source
HELICS.helicsInputSetDefaultTimeMethod
helicsInputSetDefaultTime(ipt::HELICS.Subscription, val::Union{Float64, Int64})

Set the default as a double

Arguments

  • ipt: the Input to set the default for
  • val: the default double value
source
HELICS.helicsInputSetDefaultVectorMethod
helicsInputSetDefaultVector(ipt::HELICS.Subscription, vectorInput::Array{Float64,1})

Set the default as a vector of doubles

Arguments

  • ipt: the Input to set the default for
  • vectorInput: an array of double data
source
HELICS.helicsInputSetMinimumChangeMethod
helicsInputSetMinimumChange(inp::HELICS.Subscription, tolerance::Float64)

Set the minimum change detection tolerance

Arguments

  • inp: the Input to modify
  • tolerance: the tolerance level for registering an update, values changing less than this value will not show as being updated
source

Message

HELICS.helicsMessageAppendDataMethod
helicsMessageAppendData(message::HELICS.Message, data::String)

Append data to the payload

Arguments

  • message: The message object in question
  • data: A string containing the message data to append
  • inputDataLength: The length of the data to input
source
HELICS.helicsMessageCheckFlagMethod
helicsMessageCheckFlag(message::HELICS.Message, flag::Union{Int64, HELICS.Lib.helics_federate_flags}) -> Bool

Check if a flag is set on a message

Arguments

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

Returns

  • the flags associated with a message
source
HELICS.helicsMessageGetDestinationMethod
helicsMessageGetDestination(message::HELICS.Message) -> String

Get the destination endpoint of a message

Arguments

  • message: The message object in question

Returns

  • a string with the destination endpoint
source
HELICS.helicsMessageGetMessageIDMethod
helicsMessageGetMessageID(message::HELICS.Message) -> Int64

Get the messageID of a message

Arguments

  • message: The message object in question

Returns

  • the messageID
source
HELICS.helicsMessageGetOriginalDestinationMethod
helicsMessageGetOriginalDestination(message::HELICS.Message) -> String

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

Arguments

  • message: The message object in question

Returns

  • a string with the original destination of a message
source
HELICS.helicsMessageGetOriginalSourceMethod
helicsMessageGetOriginalSource(message::HELICS.Message) -> String

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

Arguments

  • message: The message object in question

Returns

  • a string with the source of a message
source
HELICS.helicsMessageGetRawDataMethod
helicsMessageGetRawData(message::HELICS.Message) -> String

Get the raw data for a message object

  • message: A message object to get the data for
  • data: The memory location of the data
  • maxMessagelen: The maximum size of information that data can hold
  • actualSize: The actual length of data copied to data
source
HELICS.helicsMessageGetRawDataPointerMethod
helicsMessageGetRawDataPointer(message::HELICS.Message) -> Ptr{Nothing}

Get a pointer to the raw data of a message

Arguments

  • 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

source
HELICS.helicsMessageGetRawDataSizeMethod
helicsMessageGetRawDataSize(message::HELICS.Message) -> Int64

Get the size of the data payload in bytes

Arguments

  • message: The message object in question

Returns

  • the size of the data payload
source
HELICS.helicsMessageGetSourceMethod
helicsMessageGetSource(message::HELICS.Message) -> String

Get the source endpoint of a message

 message operation functions

functions for working with helics message envelopes

Arguments

  • message: The message object in question

Returns

  • a string with the source endpoint
source
HELICS.helicsMessageGetStringMethod
helicsMessageGetString(message::HELICS.Message) -> String

Get the payload of a message as a string

Arguments

  • message: The message object in question

Returns

  • a string representing the payload of a message
source
HELICS.helicsMessageGetTimeMethod
helicsMessageGetTime(message::HELICS.Message) -> Float64

Get the helics time associated with a message

Arguments

  • message: The message object in question

Returns

  • the time associated with a message
source
HELICS.helicsMessageIsValidMethod
helicsMessageIsValid(message::HELICS.Message) -> Bool

A check if the message contains a valid payload

Arguments

  • message: The message object in question

Returns

  • true if the message contains a payload
source
HELICS.helicsMessageReserveMethod
helicsMessageReserve(message::HELICS.Message, reserveSize::Int64)

Reserve space in a buffer but don't actually resize

the message data buffer will be reserved but not resized

Arguments

  • message: The message object in question
  • reserveSize: The number of bytes to reserve in the message object
source
HELICS.helicsMessageResizeMethod
helicsMessageResize(message::HELICS.Message, newSize::Int64)

Resize the data buffer for a message

the message data buffer will be resized there is no guarantees on what is in the buffer in newly allocated space if the allocated space is not sufficient new allocations will occur

Arguments

  • message: The message object in question
  • newSize: The new size in bytes of the buffer
source
HELICS.helicsMessageSetDataMethod
helicsMessageSetData(message::HELICS.Message, data::String)

Set the data payload of a message as raw data

Arguments

  • message: The message object in question
  • data: A string containing the message data
  • inputDataLength: The length of the data to input
source
HELICS.helicsMessageSetDestinationMethod
helicsMessageSetDestination(message::HELICS.Message, dest::String)

Set the destination of a message

Arguments

  • message: The message object in question
  • dest: A string containing the new destination
source
HELICS.helicsMessageSetFlagOptionMethod
helicsMessageSetFlagOption(message::HELICS.Message, flag::Union{Int64, HELICS.Lib.helics_federate_flags}, flagValue::Bool)

Set a flag on a message

Arguments

  • message: The message object in question
  • flag: An index of a flag to set on the message
  • flagValue: The desired value of the flag
source
HELICS.helicsMessageSetMessageIDMethod
helicsMessageSetMessageID(message::HELICS.Message, messageID::Int32)

Set the message ID for the message

normally this is not needed and the core of HELICS will adjust as needed

Arguments

  • message: The message object in question
  • messageID: A new message ID
source
HELICS.helicsMessageSetOriginalDestinationMethod
helicsMessageSetOriginalDestination(message::HELICS.Message, dest::String)

Set the original destination of a message

Arguments

  • message: The message object in question
  • dest: A string containing the new original source
source
HELICS.helicsMessageSetOriginalSourceMethod
helicsMessageSetOriginalSource(message::HELICS.Message, src::String)

Set the original source of a message

Arguments

  • message: The message object in question
  • src: A string containing the new original source
source
HELICS.helicsMessageSetSourceMethod
helicsMessageSetSource(message::HELICS.Message, src::String)

Set the source of a message

Arguments

  • message: The message object in question
  • src: A string containing the source
source
HELICS.helicsMessageSetStringMethod
helicsMessageSetString(message::HELICS.Message, str::String)

Set the data payload of a message as a string

Arguments

  • message: The message object in question
  • str: A string containing the message data
source
HELICS.helicsMessageSetTimeMethod
helicsMessageSetTime(message::HELICS.Message, time::Union{Float64, Int64})

Set the delivery time for a message

Arguments

  • message: The message object in question
  • time: The time the message should be delivered
source

Publication

HELICS.helicsPublicationSetOptionMethod
helicsPublicationSetOption(pub::HELICS.Publication, option::Union{Int64, HELICS.Lib.helics_handle_options}, val::Bool)

Set the data in the info field for an publication

Arguments

source

Query

HELICS.helicsQueryBrokerExecuteMethod
helicsQueryBrokerExecute(query::HELICS.Query, broker::HELICS.Broker) -> String

Execute a Query directly on a broker

the call will block until the Query finishes which may require communication or other delays

Arguments

Returns

  • a string. String will remain valid until the Query is freed or executed again

the return will be nullptr if fed or Query is an invalid object, the return string will be "#invalid" if the Query itself was invalid

source
HELICS.helicsQueryCoreExecuteMethod
helicsQueryCoreExecute(query::HELICS.Query, core::HELICS.Core) -> String

Execute a Query directly on a core

the call will block until the Query finishes which may require communication or other delays

Arguments

  • query: the Query to use in the query
  • core: the core to send the Query to

Returns

  • a string. String will remain valid until the Query is freed or executed again

the return will be nullptr if fed or Query is an invalid object, the return string will be "#invalid" if the Query itself was invalid

source
HELICS.helicsQueryExecuteMethod
helicsQueryExecute(query::HELICS.Query, fed::HELICS.Federate) -> String

Execute a query

the call will block until the Query finishes which may require communication or other delays

Arguments

Returns

  • a string. String will remain valid until the Query is freed or executed again

the return will be nullptr if fed or Query is an invalid object, the return string will be "#invalid" if the Query itself was invalid

source
HELICS.helicsQueryIsCompletedMethod
helicsQueryIsCompleted(query::HELICS.Query) -> Bool

Check if an asynchronously executed Query has completed

this function should usually be called after a QueryExecuteAsync function has been called.

Arguments

  • query: the Query to check if completed

Returns

  • will return true if an asynchronous Query has complete or a regular Query call was made with a result and false if an asynchronous Query has not completed or is invalid
source

Others

HELICS.helicsCleanupLibraryMethod
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.

source
HELICS.helicsCloseLibraryMethod
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,

source
HELICS.helicsCreateBrokerMethod
helicsCreateBroker(kind::String, name::String, initString::String) -> HELICS.Broker

Create a broker object

Arguments

  • type: the type of Broker to create
  • name: the name of Broker, may be a empty string to have a name automatically assigned
  • initString: an initialization string to send to the core-the format is similar to command line arguments. Typical options include a broker address –broker="XSSAF" if this is a subbroker or the number of federates or the address

Returns

  • a Broker object, will be NULL if there was an error indicated in the err object
source
HELICS.helicsCreateCombinationFederateMethod
helicsCreateCombinationFederate(fedName::String, fi::HELICS.FederateInfo) -> HELICS.CombinationFederate

Create a CombinationFederate from a FederateInfo object

CombinationFederate are both ValueFederate and MessageFederate, objects can be used in all functions that take a Federate, MessageFederate or ValueFederate object as an argument

Arguments

  • fedName: a string with the name of the Federate, can be NULL or an empty string to pull the default name from fi
  • fi: the FederateInfo object that contains details on the Federate

Returns

source
HELICS.helicsCreateCombinationFederateFromConfigMethod
helicsCreateCombinationFederateFromConfig(configFile::String) -> HELICS.CombinationFederate

Create a CombinationFederate from a JSON file or JSON string

CombinationFederate are both ValueFederate and MessageFederate, objects can be used in all functions that take a Federate, MessageFederate or ValueFederate object as an argument

Arguments

  • configFile: a JSON file or a JSON string or TOML file that contains setup and configuration information

Returns

source
HELICS.helicsCreateCoreMethod
helicsCreateCore(kind::String, name::String, initString::String) -> HELICS.Core

Create a core object

Arguments

  • type: the type of the core to create
  • name: the name of the core , may be a empty string to have a name automatically assigned
  • initString: an initialization string to send to the core-the format is similar to command line arguments. Typical options include a broker address –broker="XSSAF" or the number of federates or the address

Returns

  • a Core object if the core is invalid err will contain some indication
source
HELICS.helicsCreateQueryMethod
helicsCreateQuery(target::String, query::String) -> HELICS.Query

Create a Query

a Query consists of a target and query string

Arguments

  • target: the name of the target to query
  • query: the query string to make of the target
source
HELICS.helicsCreateValueFederateFromConfigMethod
helicsCreateValueFederateFromConfig(configFile::String) -> HELICS.ValueFederate

Create a value federate from a JSON file, JSON string, or TOML file

Federate objects can be used in all functions that take a Federate object as an argument

Arguments

  • configFile: a JSON file or a JSON string or TOML file that contains setup and configuration information

Returns

source
HELICS.helicsGetFederateByNameMethod
helicsGetFederateByName(fedName::String) -> HELICS.CombinationFederate

Get an existing Federate 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

Arguments

  • fedName: the name of the Federate to retrieve

Returns

  • NULL if no fed is available by that name otherwise a Federate with that name
source
HELICS.helicsIsCoreTypeAvailableMethod
helicsIsCoreTypeAvailable(kind::String) -> Bool

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

Arguments

  • type: a string representing a core type

Returns

  • a Bool

possible options include "test","zmq","udp","ipc","interprocess","tcp","default", "mpi"

source

Types

Index