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> <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> </identity>
<parameters id="texte" date="0" author="Léontine qui trottine."> <parameters id="texte" date="0" author="Léontine qui trottine.">
@ -53,8 +53,8 @@
<!-- Saved space description (initial space is sequence 0) --> <!-- Saved space description (initial space is sequence 0) -->
<savedstates id="texte" date="1630000000" author="Qui courrait dans l'herbe'"> <states id="texte" date="1630000000" author="Here, states are spaces.">
<space id="initial" date="1630000000" author="Une souris verte"> <space id="initial" date="1630000000" author="Une souris verte,">
<arrow site="1" weight="1" x="0"/> <arrow site="1" weight="1" x="0"/>
<arrow site="2" weight="1" x="1"/> <arrow site="2" weight="1" x="1"/>
<arrow site="1" weight="1" x="10"/> <arrow site="1" weight="1" x="10"/>
@ -67,7 +67,7 @@
</space> </space>
</savedstates> </states>
<!-- Model transitions definition (rules) --> <!-- Model transitions definition (rules) -->
<!-- In this version : <xs:sequence minOccurs="0" maxOccurs="unbounded">--> <!-- 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"/> <condition site="1" weight="0" node_id="3" parent="2" x="2"/>
<!-- as soon as condition 3 is satisfied, <!-- 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. --> 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"/> <condition site="2" weight="0" node_id="4" parent="2" x="-1"/>

View File

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

View File

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