Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ymmsl/v0_1/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@ class Operator(Enum):
and operators for other components such as mappers.
"""

NONE = 0 #: No operator
F_INIT = 1 #: Initialisation phase, before start of the SEL
O_I = 2 #: State observation within the model's main loop
S = 3 #: State update in the model's main loop
O_F = 5 #: Observation of final state, after the SEL

def allows_sending(self) -> bool:
"""Whether ports on this operator can send."""
return self in {Operator.NONE, Operator.O_I, Operator.O_F}
return self in {Operator.O_I, Operator.O_F}

def allows_receiving(self) -> bool:
"""Whether ports on this operator can receive."""
return self in {Operator.NONE, Operator.F_INIT, Operator.S}
return self in {Operator.F_INIT, Operator.S}


class Port:
Expand Down