WIP : erratic ---

This commit is contained in:
Jean Sirmai 2021-12-08 23:14:36 +01:00
parent 0f436bd8d6
commit c684bab6e3
Signed by: jean
GPG Key ID: FB3115C340E057E3
3 changed files with 18 additions and 14 deletions

View File

@ -12,7 +12,7 @@
<version>1.0</version>
<g_ref id="mééée..." date="1630000000" author="Léontine" lang="en">C'est qui ?'</g_ref>
<g_ref id="diff" date="1630000000" author="Léontine" lang="en">Qui ça ?'</g_ref>
</identity>
<parameters id="texte" date="0" author="Léontine qui trottine.">
@ -53,8 +53,8 @@
<!-- Saved space description (initial space is sequence 0) -->
<savedstates id="texte" date="1630000000" author="Qui courrait dans l'herbe'">
<space id="initial" date="1630000000" author="Une souris verte">
<states id="texte" date="1630000000" author="Here, states are spaces.">
<space id="initial" date="1630000000" author="Une souris verte,">
<arrow site="1" weight="1" x="0"/>
<arrow site="2" weight="1" x="1"/>
<arrow site="1" weight="1" x="10"/>
@ -65,9 +65,9 @@
<!-- Three dimers 1-1 are drawn in the global space
at locations (0,1) (10,11) and (20,21) -->
</space>
</space>
</savedstates>
</states>
<!-- Model transitions definition (rules) -->
<!-- In this version : <xs:sequence minOccurs="0" maxOccurs="unbounded">-->
@ -81,7 +81,7 @@
<condition site="1" weight="0" node_id="3" parent="2" x="2"/>
<!-- as soon as condition 3 is satisfied,
the neighbouring space unit to East of the dimer is empty
the neighbouring space unhit to East of the dimer is empty
and the dimer identified by conditions (1,2) can be moved to East. -->
<condition site="2" weight="0" node_id="4" parent="2" x="-1"/>

View File

@ -159,7 +159,7 @@
</xs:complexType>
</xs:element>
<xs:element name="savedstates">
<xs:element name="states">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="space"/>

View File

@ -37,7 +37,7 @@ class G_ref:
self.node.attrib["lang"] = lang
def get_text(self):
return self.node.text
return self.node.textdimension().get_axis
def set_text(self, text):
self.node.text = text
@ -225,7 +225,7 @@ class Objects:
def get_object(self, i):
return self.__objects[i]
## Savedstates
## States
class Space:
@ -241,7 +241,7 @@ class Space:
return self.__arrows[i]
class Savedstates:
class States:
__space = []
def __init__(self, node):
@ -379,8 +379,8 @@ class Model:
self.__parameters = child
if(child.tag == "objects"):
self.__objects = child
if(child.tag == "savedstates"):
self.__savedstates = child
if(child.tag == "states"):
self.__states = child
if(child.tag == "conditions"):
self.__conditions = child
if(child.tag == "transition"):
@ -395,8 +395,8 @@ class Model:
def get_objects(self):
return Objects(self.__objects)
def get_savedstates(self):
return Savedstates(self.__savedstates)
def get_states(self):
return States(self.__states)
def get_conditions(self):
return Conditions(self.__conditions)
@ -412,3 +412,7 @@ modelPath = "../models/dimers random walk.xml"
schemaPath = "../schemas/models_0.2.1.xmls"
testmodel = Model(modelPath, schemaPath)
state_size = testmodel.get_parameters().spaceparam.get_dimension()#.get_axis(0).get_size()
print(state_size)