EventSource

class negmas.events.EventSource[source]

Bases: object

An object capable of raising events

Methods Summary

announce(event)

Raises an event and informs all event sinks that are registered for notifications on this event type

register_listener(event_type, listener)

Registers a listener for the given event_type.

Methods Documentation

announce(event: negmas.events.Event)[source]

Raises an event and informs all event sinks that are registered for notifications on this event type

register_listener(event_type: Optional[str], listener: negmas.events.EventSink)[source]

Registers a listener for the given event_type.

Parameters
  • event_type – The type to register. If None, the listener will be registered for all types

  • listener – The listening agent (must have an on_event method that receives an event: Event and a sender: EventSource)