{
  "schema": "psut-course-public-194",
  "course": {
    "id": "iot-control",
    "title": "IoT control and gateway fundamentals",
    "description": "Editable authoring example. Model outcomes are not physical measurements."
  },
  "outcomes": [
    {
      "id": "co1",
      "text": "Explain and verify threshold-based control."
    },
    {
      "id": "co2",
      "text": "Evaluate bounded gateway capacity and message conservation."
    }
  ],
  "labs": [
    {
      "id": "control",
      "title": "Sensor threshold control",
      "objective": "Compare the controller decision below, at and above a threshold.",
      "pre": [],
      "outcomes": [
        "co1"
      ],
      "procedure": "Select the sensor input. Compare the output at 59, 60 and 61 with a threshold of 60.",
      "commands": "",
      "code": "output = int(sample >= threshold)",
      "verification": "At equality, output is ON. Below the threshold, output is OFF.",
      "cards": [
        {
          "q": "What happens at the threshold?",
          "a": "The >= comparison includes equality."
        }
      ],
      "quiz": [
        {
          "prompt": "At input 60 and threshold 60, what is the output?",
          "choices": [
            "OFF",
            "ON"
          ],
          "correct": [
            1
          ],
          "scope": "formative",
          "explanation": "Equality is included."
        }
      ],
      "simulation": {
        "type": "threshold",
        "labels": [
          "Sensor",
          "Controller",
          "Actuator"
        ],
        "params": {
          "input": 65,
          "threshold": 60
        }
      }
    },
    {
      "id": "gateway",
      "title": "Gateway queue capacity",
      "objective": "Verify message conservation in a bounded empty-buffer step.",
      "pre": [
        "control"
      ],
      "outcomes": [
        "co2"
      ],
      "procedure": "Vary arrivals, capacity and service rate. Record delivered, dropped and pending messages.",
      "commands": "",
      "code": "admitted = min(arrivals, capacity)\ndelivered = min(admitted, service)",
      "verification": "Generated messages equal delivered + dropped + pending.",
      "cards": [
        {
          "q": "What causes an overflow?",
          "a": "Arrivals exceed the buffer capacity in this empty-buffer step."
        }
      ],
      "quiz": [],
      "simulation": {
        "type": "queue",
        "labels": [
          "Arrivals",
          "Gateway",
          "Delivered"
        ],
        "params": {
          "arrivals": 12,
          "service": 8,
          "capacity": 10
        }
      }
    }
  ]
}