99 lines
No EOL
2.4 KiB
Python
99 lines
No EOL
2.4 KiB
Python
from enum import Enum
|
|
|
|
MAX_ROUT_Y = 4
|
|
|
|
GEN_TASK_START = """
|
|
<task id="{}">
|
|
<start min="0" max="0"/>
|
|
<duration min="-1" max="-1"/>
|
|
<repeat min="1" max="1"/>
|
|
<generates>
|
|
<possibility id="0">
|
|
<probability value="1"/>
|
|
<destinations>"""
|
|
GEN_TASK_END = """ </destinations>
|
|
</possibility>
|
|
</generates>
|
|
</task>"""
|
|
|
|
REQ_TASK_START = """ <task id="{}">
|
|
<start max="0" min="0"/>
|
|
<duration max="-1" min="-1"/>
|
|
<repeat max="1" min="1"/>"""
|
|
|
|
|
|
LAST_TASK = """ <task id="{}">
|
|
<start max="0" min="0"/>
|
|
<duration max="-1" min="-1"/>
|
|
<repeat max="1" min="1"/>
|
|
<requires>
|
|
<requirement id="0">
|
|
<type value="{}"/>
|
|
<source value="{}"/>
|
|
<count max="{}" min="{}"/>
|
|
</requirement>
|
|
</requires>
|
|
</task>"""
|
|
|
|
REQ_TASK_REQ = """ <requires>
|
|
<requirement id="0">
|
|
<type value="{}"/>
|
|
<source value="{}"/>
|
|
<count max="1" min="1"/>
|
|
</requirement>
|
|
</requires>"""
|
|
|
|
REQ_TASK_GEN = """ <generates>
|
|
<possibility id="0">
|
|
<probability value="1"/>
|
|
<destinations>
|
|
<destination id="0">
|
|
<delay min="50" max="50"/>
|
|
<interval min="20" max="20"/>
|
|
<count min="1" max="1"/>
|
|
<type value="{}"/>
|
|
<task value="{}"/>
|
|
</destination>
|
|
</destinations>
|
|
</possibility>
|
|
</generates>
|
|
</task>"""
|
|
|
|
DEST_HEADER = " <destination id=\"{}\">"
|
|
DEST_H_END = " </destination>"
|
|
|
|
DELAY_TAG = " <delay min=\"50\" max=\"50\"/>"
|
|
INTERVAL_TAG = " <interval min=\"20\" max=\"20\"/>"
|
|
COUNT_TAG = " <count min=\"1\" max=\"1\"/>"
|
|
TYPE_TAG = " <type value=\"{}\"/>"
|
|
TASK_TAG = " <task value=\"{}\"/>"
|
|
CONFIG_TAG = " <config link=\"{}\" destination=\"{}\"/>"
|
|
|
|
|
|
BIND = """ <bind>
|
|
<task value="{}"/>
|
|
<node value="{}"/>
|
|
</bind>"""
|
|
|
|
|
|
CONF_TYPE = """ <dataType id="{}">
|
|
<name value="ConfigRouter"/>
|
|
</dataType>"""
|
|
|
|
PACK_TYPE = """ <dataType id="{}">
|
|
<name value="Type_task_{}"/>
|
|
</dataType>"""
|
|
|
|
STREAM_TYPE = """ <dataType id="{}">
|
|
<name value="Type_task_{}_Stream"/>
|
|
</dataType>"""
|
|
|
|
class DIRS(Enum):
|
|
LOCAL = 0
|
|
EAST = 1
|
|
WEST = 2
|
|
NORTH = 3
|
|
SOUTH = 4
|
|
UP = 5
|
|
DOWN = 6
|
|
INVALID = 7 |