Skip to content

Commit

Permalink
Renamed json example
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarFdezS committed Jun 27, 2024
1 parent 7be80fd commit 95838c1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion xdevs/examples/json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ Couplings define connections between components:

```bash
$ cd xdevs/examples/json
$ python3 main.py
$ python3 json2xdevs_example.py
```
21 changes: 21 additions & 0 deletions xdevs/examples/json/json2xdevs_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import sys

from xdevs.rt import RealTimeCoordinator, RealTimeManager
from xdevs.factory import Components


if __name__ == '__main__':
file_path = sys.argv[1] if len(sys.argv) > 1 else 'gpt.json'

model = Components.from_json(file_path)
"""
# Virtual simulation
coord_v_sim = Coordinator(model)
coord_v_sim.initialize()
coord_v_sim.simulate()
"""
# Wall-clock simulation
m_rt = RealTimeManager(0.2,1)
coord_rt_sim = RealTimeCoordinator(model, m_rt)
coord_rt_sim.simulate_rt()

12 changes: 0 additions & 12 deletions xdevs/examples/json/main.py

This file was deleted.

0 comments on commit 95838c1

Please sign in to comment.