PrevTopNext

DSLR for Route Command: Checks

Two stages for checking preconditions:
  1. Ensure correctness of route.
  2. Individual checks, depending on element category
DSLR:
precondition "route: no definition"
when
    there is a set route command
    and no matching route definition
then
    send invalid route message "no such route"
    discard the command
end

precondition "refuse defined route if goal locked"
when
    there is a set route command 
    and a matching route definition # route is OK
    and a locked goal
then
    send failed route message "goal locked"
    discard the command
end

precondition "refuse route if switch locked in wrong position"
when
    there is a set route command 
    and a matching route definition # route is OK
    and a switch locked in the wrong position
then
    send failed route message "switch locked in wrong position"
    discard the command
end

precondition "refuse route if element already used by route"
when
    there is a set route command 
    and a matching route definition # route is OK
    and an element used in another route
then
    send failed route message "conflicting route"
    discard the command
end

PrevTopNext