Ejemplo n.º 1
0
 def test_is_closed(self):
     A = self.atomspace.add_node(types.ConceptNode, 'A')
     B = self.atomspace.add_node(types.ConceptNode, 'B')
     X = self.atomspace.add_node(types.VariableNode, '$X')
     AB = self.atomspace.add_link(types.InheritanceLink, [A, B])
     AX = self.atomspace.add_link(types.InheritanceLink, [A, X])
     self.assertTrue(is_closed(AB))
     self.assertFalse(is_closed(AX))
Ejemplo n.º 2
0
    def is_desirable(self, cogscm):
        """Return True iff the cognitive schematic is desirable.

        For now to be desirable a cognitive schematic must have

        0. a well define atom
        1. its confidence above zero
        2. its action fully grounded
        3. all its variables in the antecedent

        """

        return (cogscm and has_non_null_confidence(cogscm)
                and is_closed(get_t0_execution(cogscm))
                and has_all_variables_in_antecedent(cogscm))
Ejemplo n.º 3
0
    def is_desirable(self, cogscm):
        """Return True iff the cognitive schematic is desirable.

        For now to be desirable a cognitive schematic must have

        0. a well define atom
        1. its confidence above zero
        2. its action fully grounded
        3. all its variables in the antecedent

        """

        agent_log.debug("is_desirable(cogscm={})".format(cogscm))

        return cogscm \
            and has_non_null_confidence(cogscm) \
            and is_closed(get_action(cogscm)) \
            and has_all_variables_in_antecedent(cogscm)