How to use the helics.helicsGetVersion function in helics

To help you get started, we’ve selected a few helics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GMLC-TDC / HELICS / tests / python_helics / test_message_filter.py View on Github external
def AddBroker(core_type="zmq", number_of_federates=1):

    initstring = "{} --name=mainbroker".format(number_of_federates)

    helicsversion = h.helicsGetVersion()
    print("HELICS version = {}".format(helicsversion))

    # Create broker #
    broker = h.helicsCreateBroker(core_type, "", initstring)

    isconnected = h.helicsBrokerIsConnected(broker)

    if isconnected == 1:
        pass

    return broker
github GMLC-TDC / HELICS / tests / python / test_message_federate.py View on Github external
def mFed():
    initstring = "-f 1 --name=mainbroker"
    fedinitstring = "--broker=mainbroker --federates=1"
    deltat = 0.01

    h.helicsGetVersion()

    # Create broker #
    broker = h.helicsCreateBroker("zmq", "", initstring)

    isconnected = h.helicsBrokerIsConnected(broker)

    if isconnected == 1:
        pass

    # Create Federate Info object that describes the federate properties #
    fedinfo = h.helicsCreateFederateInfo()

    # Set Federate name #
    h.helicsFederateInfoSetCoreName(fedinfo, "CoreA Federate")

    # Set core type from string #
github GMLC-TDC / HELICS / tests / python / test_value_federate.py View on Github external
def helicsBroker():
    initstring = "-f 1 --name=mainbroker"
    #TODO: should add an assert here about helicsGetVersion
    h.helicsGetVersion()

    # Create broker #
    broker = h.helicsCreateBroker("zmq", "", initstring)

    isconnected = h.helicsBrokerIsConnected(broker)

    if isconnected == 1:
        pass

    yield broker

    h.helicsBrokerFree(broker)
    h.helicsCloseLibrary()
github GMLC-TDC / HELICS / tests / python / test_helics.py View on Github external
def test_version():
    import helics as h
    print(h.helicsGetVersion())
github GMLC-TDC / HELICS / tests / python / test_value_federate.py View on Github external
def vFed():

    initstring = "-f 1 --name=mainbroker"
    fedinitstring = "--broker=mainbroker --federates=1"
    deltat = 0.01
    #TODO: should add an assert here about helicsGetVersion
    h.helicsGetVersion()

    # Create broker #
    broker = h.helicsCreateBroker("zmq", "", initstring)

    isconnected = h.helicsBrokerIsConnected(broker)

    if isconnected == 1:
        pass

    # Create Federate Info object that describes the federate properties #
    fedinfo = h.helicsCreateFederateInfo()

    # Set Federate name #
    h.helicsFederateInfoSetCoreName(fedinfo, "TestA Core")

    # Set core type from string #
github GMLC-TDC / HELICS / examples / python / pi-exchange / pisender.py View on Github external
import time
import helics as h
from math import pi

initstring = "2 --name=mainbroker"
fedinitstring = "--broker=mainbroker --federates=1"
deltat = 0.01

helicsversion = h.helicsGetVersion()

print("PI SENDER: Helics version = {}".format(helicsversion))

# Create broker #
print("Creating Broker")
broker = h.helicsCreateBroker("zmq", "", initstring)
print("Created Broker")

print("Checking if Broker is connected")
isconnected = h.helicsBrokerIsConnected(broker)
print("Checked if Broker is connected")

if isconnected == 1:
    print("Broker created and connected")

# Create Federate Info object that describes the federate properties #