mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-07 02:26:28 +02:00
Start implementating platform files
This commit is contained in:
parent
54d88bce8f
commit
f7a7af979d
5 changed files with 40 additions and 1 deletions
10
esds/helpers/platform.py
Normal file
10
esds/helpers/platform.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
class YAMLPlatformFile:
|
||||||
|
|
||||||
|
def __init__(self, file_path):
|
||||||
|
self.file_path=file_path
|
||||||
|
with open(file_path) as f:
|
||||||
|
self.platform = yaml.load(f, Loader=yaml.FullLoader)
|
||||||
|
print(self.platform)
|
19
example/platform.yaml
Normal file
19
example/platform.yaml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
general:
|
||||||
|
breakpoints: []
|
||||||
|
breakpoints_every: 0
|
||||||
|
debug: off
|
||||||
|
interferences: on
|
||||||
|
|
||||||
|
nodes:
|
||||||
|
count: 5
|
||||||
|
implementations:
|
||||||
|
- file.py
|
||||||
|
|
||||||
|
interfaces:
|
||||||
|
wlan0:
|
||||||
|
wireless: yes
|
||||||
|
links:
|
||||||
|
- 0: 5-8 => 10MBps
|
||||||
|
eth0:
|
||||||
|
wireless: no
|
||||||
|
links: 5Mbps
|
7
example/platform_test.py
Executable file
7
example/platform_test.py
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from esds.helpers.platform import YAMLPlatformFile
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
simulator=YAMLPlatformFile("platform.yaml")
|
|
@ -1,6 +1,7 @@
|
||||||
[project]
|
[project]
|
||||||
name = "esds"
|
name = "esds"
|
||||||
dynamic = ["version"]
|
dynamic = ["version"]
|
||||||
|
dependencies = ["numpy","pyyaml"]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools"]
|
requires = ["setuptools"]
|
||||||
|
|
|
@ -8,7 +8,9 @@ keywords = simulator, distributed systems, cyber-physical systems, network, wire
|
||||||
license = GNU LGPLv3
|
license = GNU LGPLv3
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
install_requires = numpy
|
install_requires =
|
||||||
|
numpy
|
||||||
|
pyyaml
|
||||||
packages=find:
|
packages=find:
|
||||||
|
|
||||||
[options.packages.find]
|
[options.packages.find]
|
||||||
|
|
Loading…
Add table
Reference in a new issue