Exemplo n.º 1
0
 def add_primitive_interaction(self, experiment, result, valence):
     label = experiment.get_label() + result.get_label()
     if label not in self.INTERACTIONS:
         interaction = Interaction(label, valence)
         interaction.set_experiment(experiment)
         interaction.set_result(result)
         interaction.set_valence(valence)
         self.INTERACTIONS[label] = interaction
Exemplo n.º 2
0
 def add_primitive_interaction(self, experiment, result, valence):
     label = experiment.get_label() + result.get_label()
     if label not in self.INTERACTIONS:
         interaction = Interaction(label, valence)
         interaction.set_experiment(experiment)
         interaction.set_result(result)
         interaction.set_valence(valence)
         self.INTERACTIONS[label] = interaction
Exemplo n.º 3
0
 def addget_primitive_interaction(self,
                                  experiment,
                                  result,
                                  valence=None,
                                  meaning=None):
     label = experiment.get_label() + result.get_label()
     if label not in self.INTERACTIONS:
         interaction = Interaction(label)
         interaction.set_experiment(experiment)
         interaction.set_result(result)
         interaction.set_valence(valence)
         interaction.set_meaning(meaning)
         self.INTERACTIONS[label] = interaction
     return self.INTERACTIONS[label]
Exemplo n.º 4
0
    def initialize_interactions(self, primitive_interactions):
        for interaction in primitive_interactions:
            meaning = interaction
            experiment_label = primitive_interactions[interaction][0]
            result_label = primitive_interactions[interaction][1]
            valence = primitive_interactions[interaction][2]
            experiment = self.addget_abstract_experiment(experiment_label)
            result = self.addget_result(result_label)
            self.addget_primitive_interaction(experiment, result, valence, meaning)

        for experiment in self.EXPERIMENTS.values():
            interaction = Interaction(experiment.get_label() + "r2")
            interaction.set_valence(1)
            interaction.set_experiment(experiment)
            experiment.set_intended_interaction(interaction)
Exemplo n.º 5
0
    def initialize_interactions(self, primitive_interactions):
        for interaction in primitive_interactions:
            meaning = interaction
            experiment_label = primitive_interactions[interaction][0]
            result_label = primitive_interactions[interaction][1]
            valence = primitive_interactions[interaction][2]
            experiment = self.addget_abstract_experiment(experiment_label)
            result = self.addget_result(result_label)
            self.addget_primitive_interaction(experiment, result, valence,
                                              meaning)

        for experiment in self.EXPERIMENTS.values():
            interaction = Interaction(experiment.get_label() + "r2")
            interaction.set_valence(1)
            interaction.set_experiment(experiment)
            experiment.set_intended_interaction(interaction)
Exemplo n.º 6
0
 def addget_primitive_interaction(self, experiment, result, valence=None, meaning=None):
     """
     If a primitive interaction is not in the INTERACTIONS dictionary, add it. Otherwise just return it.
     :param experiment: (str) primitive experiment
     :param result: (str) primitive result
     :param valence: (int) valence of the interaction
     :param meaning: (str) observer's meaning of the interaction
     :return: (interaction) primitive interaction from the INTERACTIONS dictionary
     """
     label = experiment.get_label() + result.get_label()
     if label not in self.INTERACTIONS:
         interaction = Interaction(label)
         interaction.set_experiment(experiment)
         interaction.set_result(result)
         interaction.set_valence(valence)
         interaction.set_meaning(meaning)
         self.INTERACTIONS[label] = interaction
     return self.INTERACTIONS[label]
Exemplo n.º 7
0
 def addget_primitive_interaction(self,
                                  experiment,
                                  result,
                                  valence=None,
                                  meaning=None):
     """
     If a primitive interaction is not in the INTERACTIONS dictionary, add it. Otherwise just return it.
     :param experiment: (str) primitive experiment
     :param result: (str) primitive result
     :param valence: (int) valence of the interaction
     :param meaning: (str) observer's meaning of the interaction
     :return: (interaction) primitive interaction from the INTERACTIONS dictionary
     """
     label = experiment.get_label() + result.get_label()
     if label not in self.INTERACTIONS:
         interaction = Interaction(label)
         interaction.set_experiment(experiment)
         interaction.set_result(result)
         interaction.set_valence(valence)
         interaction.set_meaning(meaning)
         self.INTERACTIONS[label] = interaction
     return self.INTERACTIONS[label]