MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / execute

Method execute

masfactory/core/node.py:267–286  ·  view source on GitHub ↗

Execute one node step.

(self, outer_env:dict[str,object]|None=None)

Source from the content-addressed store, hash-verified

265 in_edge.open()
266 @masf_hook(Hook.EXECUTE)
267 def execute(self, outer_env:dict[str,object]|None=None):
268 """Execute one node step."""
269 self._update_gate_state()
270 if self.gate == Gate.OPEN:
271 self._pull_attributes(outer_env)
272 input:dict = self._message_aggregate_in()
273 output:dict = self._forward(input)
274 self._update_gate_state()
275 # Always push output to local attributes, even if there are no out_edges
276 # This ensures that _attributes_push_outer can push the correct data to outer_env
277 self._attributes_push_local(output)
278 self._attributes_push_outer(outer_env, self._attributes_store)
279 if self.gate == Gate.CLOSED:
280 self._close_out_edges()
281 return
282 self._message_dispatch_out(output)
283
284 else:
285 self._close_out_edges()
286 self._reset_gate_state()
287
288 @abstractmethod
289 @masf_hook(Hook.FORWARD)

Callers

nothing calls this directly

Calls 9

_update_gate_stateMethod · 0.95
_pull_attributesMethod · 0.95
_message_aggregate_inMethod · 0.95
_forwardMethod · 0.95
_close_out_edgesMethod · 0.95
_message_dispatch_outMethod · 0.95
_reset_gate_stateMethod · 0.95

Tested by

no test coverage detected