| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2016-10-05 15:39:19 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2016-10-05 15:39:19 +0200 |
| commit | 5872c303886568a7210082c0bd4b866bb8f71660 (patch) | |
| tree | 55756303980f69ddc4fc08003bcb110a32f8e9b0 | |
| parent | b1d478ec9adef50a4ce0891fd18b81b937ab41cd (diff) | |
net2rdp V3 release.
| -rw-r--r-- | CHANGELOG | 6 | ||||
| -rw-r--r-- | README | 18 | ||||
| -rwxr-xr-x | tina_converter.py | 6 |
3 files changed, 22 insertions, 8 deletions
@@ -2,3 +2,9 @@ VERSION 2 (Oct. 4 2016): No longer require place names to follow one another (i.e. having only places 0, 2, 99121 is now authorized). Before this version, if you had place 2, you had to have both place 0 and 1. +VERSION 3 (Oct. 5 2016): + You may now have your LeJos conditions and actions directly in the Petri net. + The use of a translation table is now optional. + Combining both of the above is allowed. + Having a translation table entry name after something already in LeJos is no + longer allowed. @@ -3,12 +3,22 @@ - A command line interface. - Python 3. - The ".net" file corresponding to your petri file (see associated section). -- A translation table (see associated section). +- A translation table (see associated section), if there are any aliases in your + Petri net. -python3 tina_converter.py NET_FILE TRANSLATION_TABLE OUTPUT_FILE +Having transitions with labels such as: +ACTION_EN_COURS=0/initNave,ETALON_CAPT_LUMIERE,raiseArm +in your Petri net is authorised. Notice that "ACTION_EN_COURS=0" is LeJos +syntax, and "initNave" is an alias. To enter LeJos actions with a parameter +directly in your Petri net, you must use the syntax +"LEJOS_ACTION_NAME:PARAM_VALUE". -Example: -python3 tina_converter.py question1.net translation_table.txt out.rdp +Calling the program: +python3 tina_converter.py [-t TRANSLATION_TABLE] NET_FILE OUTPUT_FILE + +Examples: +python3 tina_converter.py -t translation_table.txt question1.net out.rdp +python3 tina_converter.py question5.net out.rdp ## HOW TO GET THE .NET FILE #################################################### Having modeled your Petri net under Tina (http://projects.laas.fr/tina/), you diff --git a/tina_converter.py b/tina_converter.py index 8bdad33..26db9d0 100755 --- a/tina_converter.py +++ b/tina_converter.py @@ -7,8 +7,6 @@ import re # Possible improvements # - Remove the needless restriction on place names (pretty much anything should # be fine, since we're renaming them anyway. -# - Allow for a '-direct' invocation parameter, letting the user directly type -# LeTos names and operators in the Petri net. ## 'CONSTANTS' ################################################################ TINA_TRANSITION_REGEX = re.compile('tr t([0-9]+) : {(.*)} \[0,w\[ (.*) -> (.*)') @@ -22,7 +20,7 @@ CONDITION_OP['<='] = 2 CONDITION_OP['>='] = 3 CONDITION_OP['<'] = 4 CONDITION_OP['>'] = 5 -CONDITION_OPS = ['=', '<=', '>=', '<', '>'] +CONDITION_OPS = ['<=', '>=', '=', '<', '>'] CONDITION = dict() # (ID, MIN_VALUE, MAX_VALUE) @@ -509,7 +507,7 @@ parser = argparse.ArgumentParser( parser.add_argument( 'net_file', type=argparse.FileType(mode='r', encoding='UTF-8'), - help='The Tinal NET file' + help='The Tina NET file' ) parser.add_argument( '-t', |


