Sanketb2312 / TDT4113-Project5

1 stars 0 forks source link

Main-programmet #3

Open haryp2309 opened 3 years ago

haryp2309 commented 3 years ago

Implementer det som er nevnt under og sjekk at alt fungerer som det skal ved å midlertidig bytte ut agen.get_next_signal() med en vanlig Input("Skriv neste signal") bare for å teste.

  1. Create all rule objects for the FSM - and ensure they are listed in the desired order.

  2. Initialize agent, keypad and LED board

  3. Pseudo-kode:

    state ← fsm-start-state
    while state != fsm-end-state do:
        # Get next signal, typically from the keypad
        signal ← agent.get_next_signal()
        # (Rule-Application Loop)
        For rule in fsm.rules:
            IF rule.match(state, signal):
                state ← rule.next_state
                agent.do_action(rule.action, signal)
                GO TO (**)
            (**)
        End For
    End While
  4. Shutdown agent, keypad, LED board, etc.

image

💡 Tips fra lærer

HUSK at reglene sin rekkefølge har mye å si!