Skip to content

Timeslot (τ)

Bases: StateComponent

Source code in pyjamaz/state/components.py
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
class Timeslot(StateComponent):
    component_id = 11

    @log_execution_time
    def state_transition(
            self,
            header: Header
    ) -> TimeslotOutput:
        """
        GP-0.7.2-eq:6.1 (τ') | State transition function for the state's timeslot.

        Parameters
        ----------
        header: Header
            GP-0.7.2-eq:4.5 (bold_H)

        Returns
        -------
        TimeslotOutput
            Output containing: posterior state of TimeslotState (τ')
        """

        return TimeslotOutput(
            post_state=TimeslotState(
                number=header.timeslot
            )
        )

    def retrieve_state(self) -> TimeslotState:
        value = self.retrieve()
        if value is None:
            raise ValueError(f"No storage found in DB for Component ID {self.component_id}")
        return TimeslotState.from_jam_bytes(JamBytes(value))

state_transition(header: Header) -> TimeslotOutput

GP-0.7.2-eq:6.1 (τ') | State transition function for the state's timeslot.

Parameters:

Name Type Description Default
header Header

GP-0.7.2-eq:4.5 (bold_H)

required

Returns:

Type Description
TimeslotOutput

Output containing: posterior state of TimeslotState (τ')

Source code in pyjamaz/state/components.py
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@log_execution_time
def state_transition(
        self,
        header: Header
) -> TimeslotOutput:
    """
    GP-0.7.2-eq:6.1 (τ') | State transition function for the state's timeslot.

    Parameters
    ----------
    header: Header
        GP-0.7.2-eq:4.5 (bold_H)

    Returns
    -------
    TimeslotOutput
        Output containing: posterior state of TimeslotState (τ')
    """

    return TimeslotOutput(
        post_state=TimeslotState(
            number=header.timeslot
        )
    )