{ "version": "v0.1", "hils": [ { "name": "water_hil", "warmup_s": 3.0, "init": { "water_tank_level": 500, "tank_input_valve": 0, "tank_output_valve": 0 }, "params": { "tank_max": 1000, "tank_min": 0, "inflow_rate": 18, "outflow_rate": 12 }, "tasks": [ { "type": "loop", "name": "tank_dynamics", "dt_s": 0.5, "actions": [ { "if": "tank_input_valve > 0.5", "then": [ {"add": ["water_tank_level", "inflow_rate"]} ] }, { "if": "tank_output_valve > 0.5", "then": [ {"add": ["water_tank_level", "-outflow_rate"]} ] }, {"set": ["water_tank_level", "clamp(water_tank_level, tank_min, tank_max)"]} ] } ] }, { "name": "filler_hil", "warmup_s": 3.0, "init": { "bottle_fill_level": 0, "bottle_at_filler": 1, "bottle_distance": 0, "conveyor_cmd": 0, "fill_valve": 0 }, "params": { "bottle_max": 200, "bottle_min": 0, "distance_reset": 130, "filler_range": 30, "fill_rate": 8, "conveyor_speed": 5 }, "tasks": [ { "type": "loop", "name": "filler_dynamics", "dt_s": 0.5, "actions": [ { "if": "fill_valve > 0.5 and bottle_at_filler > 0.5", "then": [ {"add": ["bottle_fill_level", "fill_rate"]} ] }, {"set": ["bottle_fill_level", "clamp(bottle_fill_level, bottle_min, bottle_max)"]}, { "if": "conveyor_cmd > 0.5", "then": [ {"add": ["bottle_distance", "-conveyor_speed"]}, { "if": "bottle_distance < 0", "then": [ {"set": ["bottle_distance", "distance_reset"]}, {"set": ["bottle_fill_level", "0"]} ] } ] }, {"set": ["bottle_at_filler", "1 if bottle_distance <= filler_range else 0"]} ] } ] } ] }