Esempio n. 1
0
 def customize_infra_agent_in_degree_low(agent: Number) -> Symbol:
     if agent.number < 2:
         return Number(0)
     else:
         return Number(2)
Esempio n. 2
0
 def theory_term_number(self, term_id: int, number: int) -> None:
     self._output("theory_number", [Number(term_id), Number(number)])
Esempio n. 3
0
 def theory_term_string(self, term_id: int, name: str) -> None:
     self._output("theory_string", [Number(term_id), String(name)])
Esempio n. 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)])
Esempio n. 5
0
 def assume(self, literals: Sequence[int]) -> None:
     for lit in literals:
         self._output("assume", [Number(lit)])
Esempio n. 6
0
 def nia(self) -> Symbol:
     return Number(self.number_of_infra_agents)
Esempio n. 7
0
 def project(self, atoms: Sequence[int]) -> None:
     for atom in atoms:
         self._output("project", [Number(atom)])
Esempio n. 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])]
Esempio n. 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))
Esempio n. 10
0
 def product_agent_out_degree_low(self, agent: Number) -> Symbol:
     return Number(self.product_agent_profile["out_degree"][0])
Esempio n. 11
0
 def product_agent_in_degree_high(self, agent: Number) -> Symbol:
     return Number(self.product_agent_profile["in_degree"][1])
Esempio n. 12
0
 def infra_agent_in_degree_high(self, agent: Number) -> Symbol:
     return Number(self.infra_agent_profile["in_degree"][1])
Esempio n. 13
0
 def infra_agent_out_degree_low(self, agent: Number) -> Symbol:
     return Number(self.infra_agent_profile["out_degree"][0])
Esempio n. 14
0
 def npa(self) -> Symbol:
     return Number(self.number_of_product_agents)
Esempio n. 15
0
def _theory(i: Symbol, pos: int, lit: int) -> Sequence[Symbol]:
    return [i, Number(pos), Number(lit)]
Esempio n. 16
0
 def minimize(self, priority: int, literals: Sequence[Tuple[int,
                                                            int]]) -> None:
     self._output(
         "minimize",
         [Number(priority), self._wlit_tuple(literals)])
Esempio n. 17
0
def _lit(i: Symbol, pos: int, lit: int) -> Sequence[Symbol]:
    # pylint: disable=unused-argument
    return [i, Number(lit)]
Esempio n. 18
0
 def nl(self) -> Symbol:
     return Number(self.number_of_leaves)