Skip to content

LIN-Phys

feral3gp.feral.linphys(config, director=Simulation.director_de)

Source code in feral3gp/feral/network/linphys.py
49
50
51
52
53
54
55
56
57
def linphys(config: LINPhysConfig, director=Simulation.director_de) -> JLINPhysNetwork:
    number_of_nodes = len(config.nodes)
    java_linphys_network = JDefaultLINPhysNetwork(config.name, director, number_of_nodes)
    __configure_linphys_network(config=config, java_linphys_network=java_linphys_network)

    __configure_nodes(config=config, network=java_linphys_network, configure_func=__configure_linphys_node)
    __configure_console(java_component=java_linphys_network, config=config.console)

    return java_linphys_network

feral3gp.feral.LINPhysConfig dataclass

Bases: NetworkConfig

The configuration of the LINPhys network

Source code in feral3gp/feral/network/linphys_config.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@dataclass
class LINPhysConfig(NetworkConfig):
    """
    The configuration of the LINPhys network
    """

    name: str = "unnamed LINPhys network"
    """The name of the network"""

    num_slaves: int = "2"
    """The number of slaves that exists (additional to the master)"""

    bit_rate: int = 19200
    """The bitrate of the bis in Bits/s"""

    sync_break_length_in_bits: int = 13
    """The size of the Sync Break in bits (excluding the delimiter length)"""

    sync_break_delimiter_length_in_bits: int = 1
    """The size of the Sync Break Delimiter in bits"""

    inter_byte_space: int = 0
    """The length if the Inter-Byte-Space in ns"""

    response_space: int = 0
    """The length of the Response Space in ns"""

    jitter_range: typing.Tuple[int, int] = (0, 0)
    """
    The range of the jitter for master to start sending in nanoseconds. 
    Must both be positive. 
    First element lower bound, second one upper bound. 
    """

    time_base: int = millis(5)
    """The time base for the LIN master in ns. Must be positive."""

bit_rate: int = 19200 class-attribute instance-attribute

The bitrate of the bis in Bits/s

inter_byte_space: int = 0 class-attribute instance-attribute

The length if the Inter-Byte-Space in ns

jitter_range: typing.Tuple[int, int] = (0, 0) class-attribute instance-attribute

The range of the jitter for master to start sending in nanoseconds. Must both be positive. First element lower bound, second one upper bound.

name: str = 'unnamed LINPhys network' class-attribute instance-attribute

The name of the network

num_slaves: int = '2' class-attribute instance-attribute

The number of slaves that exists (additional to the master)

response_space: int = 0 class-attribute instance-attribute

The length of the Response Space in ns

sync_break_delimiter_length_in_bits: int = 1 class-attribute instance-attribute

The size of the Sync Break Delimiter in bits

sync_break_length_in_bits: int = 13 class-attribute instance-attribute

The size of the Sync Break in bits (excluding the delimiter length)

time_base: int = millis(5) class-attribute instance-attribute

The time base for the LIN master in ns. Must be positive.