factor_agent.gate.Gate#

class Gate(config, vocabulary, seen=())[source]#

Bases: object

Check candidates; see the module docstring for the order of the checks.

A gate remembers the ranking of every candidate it passed and rejects a later candidate that only keeps or reverses one.

Parameters:
configGateConfig

The sandbox limits and the graph constraints.

vocabularyVocabulary

The fields, operators and parameter values candidates may use; the sandbox rebuilds the same one from its sources.

seeniterable of Graph, optional

The graphs of candidates passed before, such as those of a campaign that is resumed; a candidate that keeps or reverses one’s ranking (Graph.ranking) is a duplicate.

Methods#

Gate.check

Return Passed with the candidate's graph, or Rejected with why not.

Gate.withdraw

Forget that graph passed, so a rewrite of its candidate is not refused as its duplicate.