:feat enfin les consos git add -A!

This commit is contained in:
Guillotin Damien 2021-12-10 17:58:42 +01:00
parent 9d9c20a9d7
commit 2c68679d91
4 changed files with 101 additions and 2 deletions

View file

@ -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)
}

View file

@ -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

View file

@ -0,0 +1 @@
/fr/

View file

@ -0,0 +1 @@
/fr/