MCPcopy Index your code
hub / github.com/microsoft/MarS / push_event

Method push_event

mlib/core/engine.py:54–64  ·  view source on GitHub ↗

Push event.

(self, event: Event)

Source from the content-addressed store, hash-verified

52 self.agents[agent.agent_id] = agent
53
54 def push_event(self, event: Event) -> None:
55 """Push event."""
56 max_event_id = 1000000000
57 if isinstance(event, MarketCloseEvent):
58 event.event_id = max_event_id
59 else:
60 event.event_id = self._num_event
61 self._num_event += 1
62 assert event.event_id < max_event_id
63 heapq.heappush(self.events, event)
64 self._log(f"received new event, type: {event.__class__.__name__}, {event.time}")
65
66 def push_events(self, events: list[Event]) -> None:
67 """Push events."""

Calls 1

_logMethod · 0.95

Tested by 2

test_priority_queueFunction · 0.76