Exemple #1
0
class NoticeCountSameAsTarget(AcNode):
    threshold = 1.0
    acs = [
        OrFail(LookFor(OfClass(Count), asgn_to='node1'),
               CantFind.from_env(criteria=OfClass(Count))),
        OrFail(LookFor(OfClass(Target), asgn_to='node2'),
               CantFind.from_env(criteria=OfClass(Target))),
        OrFail(EqualValue(),
               NotEqualValue.from_env(node1='node1', node2='node2')),
        Taggees('node1', 'node2'),
        TagWith(SameValue)
    ]
Exemple #2
0
class AddAllInGlom(AcNode):
    threshold = 1.0
    acs = [
        All(And(OfClass(Number), CTagged(Avail))),
        WithNameOverride(LookFor(And(OfClass(Plus), CTagged(Allowed)),
                                 focal_point=InWorkspace),
                         focal_point='opwithin'),
        AddNode(
            Proposal,
            action=ConsumeOperands(),
            proposed_operands='nodes',
            proposed_operator='node',
        )
    ]
Exemple #3
0
class ProposeDoingNoticedOperation(Persistent, AcNode):
    acs = [
        LookFor(OperatorWithAvailOperands(),
                focal_point=InWorkspace,
                asgn_to='operator'),
        #AsgnNeighbors(node='operator', port_label=Quote('operands')),
        AsgnProposedNeighbors(node='operator', port_label=Quote('operands')),
        AddNode(
            Proposal,
            action=ConsumeOperands(),
            #proposed_operands='operands',
            neighbors='proposed',
            # HACKish: neighbors is a dict; handled specially by AddNode
            proposed_operator='operator',
            completion_of='this',
            support_from='this'),
        Boost(nodes='node')
    ]
Exemple #4
0
class NoticeSolved(Persistent, AcNode):
    acs = [
        LookFor(OfClass(Target), asgn_to='target'),
        LookFor(CTagged(Avail), cond=EqualValue('node', 'target')),
        Raise(NumboSuccess, node='node', target='target')
    ]
Exemple #5
0
 class Looker(AcNode):
     acs = [LookFor(OfClass(Count)), Raise(FoundNode, node='node')]
Exemple #6
0
 class NoticeSolved(AcNode):
     acs = [
         LookFor(CTagged(Avail), cond=EqualValue('node', 'target')),
         Raise(NumboSuccess, node='node', target='target')
     ]
Exemple #7
0
 class FindPlus(AcNode):
     acs = [
         LookFor(Plus, focal_point=MyContext),
         Raise(FoundNode, node='node')
     ]
Exemple #8
0
 class FindPlus(AcNode):
     acs = [
         LookFor(OfClass(Plus), focal_point=InWorkspace),
         Raise(FoundNode, node='node')
     ]