In [2]:
import lib.operations as operations # basic variables concerning operations
from lib.schemas import * # related to the mathematical structure of the problem
from lib.textRepresentations import * # related to the propositions constituting the problem
from lib.subjectRepresentations import * # related to the problem state of a subject (representations and quantities)
from lib.paths import * # related to the solving process and its storing and analysis
from lib.dataManager import * # related to the final steps in the process gathering and printing results of simulation
In [3]:
simulatedDatas=SimulatedDatas()
simulatedDatas.pickleLoad("simulation24072014.pkl")
Redundancies in the simulation has been drastically reduced by considering a solution path is new if and only the couple {formula,reinterpretations recquired} is new. Indeed, may paths generated by the programm computes unnecessary unkowns and produce unecessary reinterpretations. Even if this behavior can be found in students, this is not the core of our study.
In [4]:
for i in range(5,15):
data=simulatedDatas.datas[i]
print (data["path"].formula, data["path"].interpretationsList, data["problem"], data["model"])
In [5]:
path=data["path"]
In [6]:
dic=simulatedDatas.buildBigDic()
In [7]:
move=path.richInterpretationsList[0]
In [8]:
print(data["path"].interpretationsList)
for move in path.richInterpretationsList:
print(move.indexTextInformation)
print(move.indexSelectedRepresentation)
In [9]:
schema1=Schema("PoissonEF","PoissonEI",operations.addition,"PoissonGAIN","change")
schema2=Schema("ViandeEF","ViandeEI",operations.addition,"ViandeGAIN","change")
struct=ProblemStructure()
struct.addSchema(schema1)
struct.addSchema(schema2)
struct.addBridgingSchemas(schema1,schema2)
struct.updateObjectSet()
text=Text()
text.addTextInformation(TextInformation(Representation(Quantity("PoissonGAIN","P1"),'Au supermarché, le kilo de poisson a augmenté de 5 euros cette année')))
text.addTextInformation(TextInformation(Representation(Quantity("PoissonEF","T1"),'Un kilo de poisson coute maintenant 12 euros.')))
text.addTextInformation(TextInformation(Representation(Quantity("PoissonEIminusViandeEI","dEI"),'Au début de l\'année, le kilo de viande coutait le même prix que le kilo de poisson.')))
text.addTextInformation(TextInformation(Representation(Quantity("PoissonGAINminusViandeGAIN","d"),'Le kilo de viande a augmenté de 3 euros de moins que le kilo de poisson')))
text.setGoal(TextGoal(Goal('ViandeEF','Combien coute le kilo de viande maintenant?')))
text.getTextInformation(0).addAlternativeRepresentation(Representation(Quantity("PoissonEI","P1"),'Au supermarché, le kilo de poisson était de 5 euros'))
text.getTextInformation(0).addAlternativeRepresentation(Representation(Quantity("PoissonEF","P1"),'Au supermarché, le kilo de poisson coute 5 euros'))
text.getTextInformation(1).addAlternativeRepresentation(Representation(Quantity("PoissonEI","T1"),'Un kilo de poisson était de 12 euros.'))
text.getTextInformation(2).addAlternativeRepresentation(Representation(Quantity("PoissonEFminusViandeEF","dEI"),'Au la fin de l\'année, le kilo de viande coute le même prix que le kilo de poisson.'))
text.getTextInformation(2).addAlternativeRepresentation(Representation(Quantity("PoissonGAINminusViandeGAIN","dEI"),'Le kilo de viande a augmenté du même prix que le kilo de poisson.'))
text.getTextInformation(3).addAlternativeRepresentation(Representation(Quantity("ViandeGAIN","d"),'Le kilo de viande a augmenté de 3 euros'))
text.getTextInformation(3).addAlternativeRepresentation(Representation(Quantity("ViandeGAIN","-d"),'Le kilo de viande a diminué de 3 euros'))
text.getTextInformation(3).addAlternativeRepresentation(Representation(Quantity("PoissonGAINminusViandeGAIN","-d"),'Le kilo de viande a augmenté de 3 euros de plus que le kilo de poisson'))
text.getTextInformation(3).addAlternativeRepresentation(Representation(Quantity("PoissonEFminusViandeEF","d"),'Le kilo de viande vaut 3 euros de moins que le kilo de poisson'))
text.getTextInformation(3).addAlternativeRepresentation(Representation(Quantity("PoissonEFminusViandeEF","-d"),'Le kilo de viande vaut 3 euros de plus que le kilo de poisson'))
text.getTextInformation(3).addAlternativeRepresentation(Representation(Quantity("ViandeEF","d"),'Le kilo coute 3 euros à la fin'))
problemTc4t=Problem(struct,text)
problemTc4t.name="Tc4t"
In [11]:
t=problemTc4t.text.textInformations[0]
In [17]:
float (5)/8
Out[17]: