:feat enfin les consos git add -A!
This commit is contained in:
parent
9d9c20a9d7
commit
2c68679d91
|
@ -114,6 +114,13 @@ def: getPlace(): petrinet!Place =
|
|||
->asSequence()
|
||||
->first();
|
||||
|
||||
helper context String
|
||||
def : getObjet() : game!Objet =
|
||||
game!Objet.allInstances()
|
||||
->select(o | o.nom.nom = self)
|
||||
->asSequence()
|
||||
->first();
|
||||
|
||||
helper context game!Personne
|
||||
def: getLieu(): game!Lieu =
|
||||
game!Lieu.allInstances()
|
||||
|
@ -230,6 +237,17 @@ rule Chemin2PetriNet {
|
|||
transition <- t,
|
||||
outgoing <- true,
|
||||
weight <- 1)
|
||||
do {
|
||||
for (o in c.objetsConso) {
|
||||
thisModule.consoObjet(t, o.nom);
|
||||
}
|
||||
for (o in c.objetsRecus) {
|
||||
thisModule.recuObjet(t, o.nom);
|
||||
}
|
||||
for (con in c.connaissances) {
|
||||
thisModule.recuConn(t, con.nom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rule Interaction2PetriNet {
|
||||
|
@ -250,6 +268,17 @@ rule Interaction2PetriNet {
|
|||
transition <- t,
|
||||
outgoing <- false,
|
||||
weight <- 1)
|
||||
do {
|
||||
for (o in i.objetsConso) {
|
||||
thisModule.consoObjet(t, o.nom);
|
||||
}
|
||||
for (o in i.objetsRecus) {
|
||||
thisModule.recuObjet(t, o.nom);
|
||||
}
|
||||
for (c in i.connaissances) {
|
||||
thisModule.recuConn(t, c.nom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rule Action2PetriNet {
|
||||
|
@ -270,4 +299,72 @@ rule Action2PetriNet {
|
|||
transition <- t,
|
||||
outgoing <- true,
|
||||
weight <- 1)
|
||||
do {
|
||||
for (o in a.objetsConso) {
|
||||
thisModule.consoObjet(t, o.nom);
|
||||
}
|
||||
for (o in a.objetsRecus) {
|
||||
thisModule.recuObjet(t, o.nom);
|
||||
}
|
||||
for (c in a.connaissances) {
|
||||
thisModule.recuConn(t, c.nom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rule consoObjet(t : game!Transition, s : String) {
|
||||
to
|
||||
arc : petrinet!Arc(
|
||||
place <- t.getPlace('objet_' + s),
|
||||
transition <- t,
|
||||
outgoing <- false,
|
||||
weight <- 1),
|
||||
|
||||
arcNeg : petrinet!Arc(
|
||||
place <- t.getPlace('objet_' + s + '_neg'),
|
||||
transition <- t,
|
||||
outgoing <- true,
|
||||
weight <- 1),
|
||||
|
||||
arcTaille : petrinet!Arc(
|
||||
place <- t.getPlace('taille'),
|
||||
transition <- t,
|
||||
outgoing <- true,
|
||||
weight <- s.getObjet().taille)
|
||||
}
|
||||
|
||||
rule recuObjet(t : game!Transition, s : String) {
|
||||
to
|
||||
arc : petrinet!Arc(
|
||||
place <- t.getPlace('objet_' + s),
|
||||
transition <- t,
|
||||
outgoing <- true,
|
||||
weight <- 1),
|
||||
|
||||
arcNeg : petrinet!Arc(
|
||||
place <- t.getPlace('objet_' + s + '_neg'),
|
||||
transition <- t,
|
||||
outgoing <- false,
|
||||
weight <- 1),
|
||||
|
||||
arcTaille : petrinet!Arc(
|
||||
place <- t.getPlace('taille'),
|
||||
transition <- t,
|
||||
outgoing <- false,
|
||||
weight <- s.getObjet().taille)
|
||||
}
|
||||
|
||||
rule recuConn(t : game!Transition, s : String) {
|
||||
to
|
||||
arc : petrinet!Arc(
|
||||
place <- t.getPlace('connaissance_' + s),
|
||||
transition <- t,
|
||||
outgoing <- true,
|
||||
weight <- 1),
|
||||
|
||||
arcNeg : petrinet!Arc(
|
||||
place <- t.getPlace('connaissance_' + s + '_neg'),
|
||||
transition <- t,
|
||||
outgoing <- false,
|
||||
weight <- 1)
|
||||
}
|
|
@ -11,5 +11,5 @@ pl lieu_Echec (0)
|
|||
tr chemin_win lieu_Enigme*1 -> lieu_Succes*1
|
||||
tr chemin_loose lieu_Enigme*1 -> lieu_Echec*1
|
||||
tr interaction_Parler lieu_Enigme*1 -> personne_Sphinx*1
|
||||
tr action_Reponse_1 personne_Sphinx*1 -> lieu_Enigme*1
|
||||
tr action_Reponse_2 personne_Sphinx*1 -> lieu_Enigme*1 invalid*1
|
||||
tr action_Reponse_1 personne_Sphinx*1 connaissance_Reussite_neg*1 -> lieu_Enigme*1 connaissance_Reussite*1
|
||||
tr action_Reponse_2 personne_Sphinx*1 objet_tentative*1 -> lieu_Enigme*1 objet_tentative_neg*1 taille*1
|
||||
|
|
1
workspace/fr.n7.game.toPrototype/bin/.gitignore
vendored
Normal file
1
workspace/fr.n7.game.toPrototype/bin/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/fr/
|
1
workspace/fr.n7.petrinet.toTINA/bin/.gitignore
vendored
Normal file
1
workspace/fr.n7.petrinet.toTINA/bin/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/fr/
|
Loading…
Reference in a new issue