예제 #1
0
 def customize_infra_agent_in_degree_low(agent: Number) -> Symbol:
     if agent.number < 2:
         return Number(0)
     else:
         return Number(2)
예제 #2
0
 def theory_term_number(self, term_id: int, number: int) -> None:
     self._output("theory_number", [Number(term_id), Number(number)])
예제 #3
0
 def theory_term_string(self, term_id: int, name: str) -> None:
     self._output("theory_string", [Number(term_id), String(name)])
예제 #4
0
 def external(self, atom: int, value: TruthValue) -> None:
     value_name = str(value).replace('TruthValue.', '').lower().rstrip('_')
     self._output("external", [Number(atom), Function(value_name)])
예제 #5
0
 def assume(self, literals: Sequence[int]) -> None:
     for lit in literals:
         self._output("assume", [Number(lit)])
예제 #6
0
 def nia(self) -> Symbol:
     return Number(self.number_of_infra_agents)
예제 #7
0
 def project(self, atoms: Sequence[int]) -> None:
     for atom in atoms:
         self._output("project", [Number(atom)])
예제 #8
0
def _wlit(i: Symbol, pos: int, wlit: Tuple[int, int]) -> Sequence[Symbol]:
    # pylint: disable=unused-argument
    return [i, Number(wlit[0]), Number(wlit[1])]
예제 #9
0
 def _output(self, name: str, args: Sequence[Symbol]):
     if self._reify_steps:
         args = list(args) + [Number(self._step)]
     self._cb(Function(name, args))
예제 #10
0
 def product_agent_out_degree_low(self, agent: Number) -> Symbol:
     return Number(self.product_agent_profile["out_degree"][0])
예제 #11
0
 def product_agent_in_degree_high(self, agent: Number) -> Symbol:
     return Number(self.product_agent_profile["in_degree"][1])
예제 #12
0
 def infra_agent_in_degree_high(self, agent: Number) -> Symbol:
     return Number(self.infra_agent_profile["in_degree"][1])
예제 #13
0
 def infra_agent_out_degree_low(self, agent: Number) -> Symbol:
     return Number(self.infra_agent_profile["out_degree"][0])
예제 #14
0
 def npa(self) -> Symbol:
     return Number(self.number_of_product_agents)
예제 #15
0
def _theory(i: Symbol, pos: int, lit: int) -> Sequence[Symbol]:
    return [i, Number(pos), Number(lit)]
예제 #16
0
 def minimize(self, priority: int, literals: Sequence[Tuple[int,
                                                            int]]) -> None:
     self._output(
         "minimize",
         [Number(priority), self._wlit_tuple(literals)])
예제 #17
0
def _lit(i: Symbol, pos: int, lit: int) -> Sequence[Symbol]:
    # pylint: disable=unused-argument
    return [i, Number(lit)]
예제 #18
0
 def nl(self) -> Symbol:
     return Number(self.number_of_leaves)