Skip to content
Snippets Groups Projects
demon.mli 1.41 KiB
Newer Older
(* Time-stamp: <modified the 13/05/2019 (at 17:08) by Erwan Jahier> *)
erwan's avatar
erwan committed

type t =
  | Synchronous (* select all actions *) 
  | Central (* select 1 action *)
  | LocallyCentral (* never activates two neighbors actions in the same step *)
  | Distributed (* select at least one action *)
  | Custom (* enable/actions are communicated via stdin/stdout in RIF *)
erwan's avatar
erwan committed

type pna = Process.t * Algo.neighbor list * Algo.action

(** f dummy_input_flag verbose_mode demon pl actions_ll enab

inputs:
- dummy_input_flag: true when used with --ignore-first-inputs 
- verbose_mode: true when the verbose level is > 0
- demon: 
- pl:
- actions_ll: list of list of existing actions 
- enab_ll: list of list of enabled actions
    At the inner list level, exactly one action ougth to be chosen. At the
    outter list level, the number of chosen actions depends on the kind
    of demons.
    In custom mode, as a side-effect, read on stdin which actions should be activated.

returns:
   - a string containing the values (in RIF) of activating variables
   - the list of activated actions

nb: it is possible that we read on stdin that an action should be
   activated even if it is not enabled (which would be a demon
   "error").  For the time being, we ignore the demon "error" and
   inhibit the activation.
val f : bool -> bool -> t -> Process.t list -> pna list list -> bool list list ->
  (string -> string -> bool) -> bool list list * pna list
erwan's avatar
erwan committed