Skip to content

FMI2

feral3gp.feral.fmi2(config, director=Simulation.director_dt)

Source code in feral3gp/feral/fmi/fmi2.py
48
49
50
51
52
53
54
55
56
57
58
59
def fmi2(config: FMI2Config, director=Simulation.director_dt):
    __check(config)
    fmu_file_name = config.file_name
    name = config.name  # TODO what to do with the name? Java Constructor does not have a name parameter

    java_fmi2_worker = JFMU2WorkerCS(director, fmu_file_name)
    java_fmi2_worker.setName(name)

    __configure_fmu_ports(java_fmi2_worker, config.ports)
    __configure_console(java_fmi2_worker, config.console)

    return java_fmi2_worker

feral3gp.feral.FMI2Config dataclass

Source code in feral3gp/feral/fmi/fmi2_config.py
25
26
27
28
29
30
31
32
33
34
@dataclass
class FMI2Config:
    name: str = None
    file_name: str = None
    console: ConsoleConfig = None
    """
    If no console config is provided, the network will use the default 
    console of the simulation
    """
    ports: typing.List[FMI2PortConfig] = None

console: ConsoleConfig = None class-attribute instance-attribute

If no console config is provided, the network will use the default console of the simulation

feral3gp.feral.FMI2PortConfig dataclass

Source code in feral3gp/feral/fmi/fmi2_config.py
13
14
15
16
17
18
19
20
21
22
@dataclass
class FMI2PortConfig:
    name: str = None
    """
    The name of the port
    """
    type: FMI2PortType = None
    """
    The type of the port
    """

name: str = None class-attribute instance-attribute

The name of the port

type: FMI2PortType = None class-attribute instance-attribute

The type of the port

feral3gp.feral.FMI2PortType

Bases: Enum

Source code in feral3gp/feral/fmi/fmi2_config.py
 7
 8
 9
10
class FMI2PortType(Enum):
    INPUT = 0
    OUTPUT_REAL = 1
    OUTPUT_INTEGER = 2