{
  "entity_types": [
    {
      "name": "Process"
    },
    {
      "name": "Signal"
    }
  ],
  "containers": [
    {
      "name": "READY_QUEUE",
      "kind": "simple",
      "entity_type": "Process"
    },
    {
      "name": "CPU0",
      "kind": "slot",
      "entity_type": "Process"
    },
    {
      "name": "CPU1",
      "kind": "slot",
      "entity_type": "Process"
    },
    {
      "name": "BLOCKED",
      "kind": "simple",
      "entity_type": "Process"
    },
    {
      "name": "TERMINATED",
      "kind": "simple",
      "entity_type": "Process"
    },
    {
      "name": "TIMER_EXPIRED",
      "kind": "simple",
      "entity_type": "Signal"
    },
    {
      "name": "IO_COMPLETE",
      "kind": "simple",
      "entity_type": "Signal"
    },
    {
      "name": "SIGNAL_DONE",
      "kind": "simple",
      "entity_type": "Signal"
    }
  ],
  "moves": [
    {
      "name": "schedule",
      "from": [
        "READY_QUEUE"
      ],
      "to": [
        "CPU0",
        "CPU1"
      ],
      "entity_type": "Process"
    },
    {
      "name": "preempt",
      "from": [
        "CPU0",
        "CPU1"
      ],
      "to": [
        "READY_QUEUE"
      ],
      "entity_type": "Process"
    },
    {
      "name": "block",
      "from": [
        "CPU0",
        "CPU1"
      ],
      "to": [
        "BLOCKED"
      ],
      "entity_type": "Process"
    },
    {
      "name": "unblock",
      "from": [
        "BLOCKED"
      ],
      "to": [
        "READY_QUEUE"
      ],
      "entity_type": "Process"
    },
    {
      "name": "exit_process",
      "from": [
        "CPU0",
        "CPU1"
      ],
      "to": [
        "TERMINATED"
      ],
      "entity_type": "Process"
    },
    {
      "name": "consume_signal",
      "from": [
        "TIMER_EXPIRED",
        "IO_COMPLETE"
      ],
      "to": [
        "SIGNAL_DONE"
      ],
      "entity_type": "Signal"
    }
  ],
  "tensions": [
    {
      "name": "schedule_ready",
      "priority": 10,
      "match": [
        {
          "bind": "proc",
          "in": "READY_QUEUE",
          "select": "max_by",
          "key": "priority"
        },
        {
          "bind": "cpu",
          "empty_in": [
            "CPU0",
            "CPU1"
          ],
          "select": "first"
        }
      ],
      "emit": [
        {
          "move": "schedule",
          "entity": "proc",
          "to": "cpu"
        }
      ]
    },
    {
      "name": "timer_preempt",
      "priority": 5,
      "match": [
        {
          "bind": "sig",
          "in": "TIMER_EXPIRED",
          "select": "first"
        },
        {
          "bind": "proc",
          "in": "CPU0",
          "select": "first",
          "required": false
        }
      ],
      "emit": [
        {
          "move": "consume_signal",
          "entity": "sig",
          "to": "SIGNAL_DONE"
        },
        {
          "move": "preempt",
          "entity": "proc",
          "to": "READY_QUEUE"
        }
      ]
    },
    {
      "name": "io_unblock",
      "priority": 5,
      "match": [
        {
          "bind": "sig",
          "in": "IO_COMPLETE",
          "select": "first"
        },
        {
          "bind": "proc",
          "in": "BLOCKED",
          "select": "first",
          "required": false
        }
      ],
      "emit": [
        {
          "move": "consume_signal",
          "entity": "sig",
          "to": "SIGNAL_DONE"
        },
        {
          "move": "unblock",
          "entity": "proc",
          "to": "READY_QUEUE"
        }
      ]
    }
  ],
  "entities": [
    {
      "name": "init",
      "type": "Process",
      "in": "READY_QUEUE",
      "properties": {
        "priority": 1
      }
    },
    {
      "name": "shell",
      "type": "Process",
      "in": "READY_QUEUE",
      "properties": {
        "priority": 5
      }
    },
    {
      "name": "daemon",
      "type": "Process",
      "in": "READY_QUEUE",
      "properties": {
        "priority": 10
      }
    }
  ]
}
