Logging

class dsns.logging.MessageData(message, source, destination, start_time, end_time, hops, delivered, dropped, drop_reason, aborted)
message: BaseMessage

Alias for field number 0

source: int

Alias for field number 1

destination: int | None

Alias for field number 2

start_time: float

Alias for field number 3

end_time: float | None

Alias for field number 4

hops: int | None

Alias for field number 5

delivered: bool

Alias for field number 6

dropped: bool

Alias for field number 7

drop_reason: DropReason | None

Alias for field number 8

aborted: bool

Alias for field number 9

class dsns.logging.PreprocessedLoggingActor(log_other: bool = False)

Actor that logs events, producing a preprocessed log aggregating message information.

direct_messages: dict[DirectMessage, MessageData] = {}
broadcast_messages: dict[BroadcastMessage, MessageData] = {}
other_events: list[Event] = []
__init__(log_other: bool = False)
Parameters:

log_other – Whether to log other events (i.e. non-message events).

log_other: bool = False
initialize() list[Event]

Initialize the actor.

Returns:

List of events to add to the event queue.

create_message_data(message: BaseMessage) MessageData
update_message(message: BaseMessage, **kwargs)
handle_event(mobility, event)

Handle an event.

Parameters:
  • mobility – The mobility model to handle the event with.

  • event – The event to handle.

Returns:

List of events to add to the event queue.

class dsns.logging.Interval(*, start_time: float, end_time: float)
start_time: float
end_time: float
__init__(*, start_time: float, end_time: float) None
class dsns.logging.BandwidthLoggingActor

Actor that logs bandwidth congestion over time for each link.

__init__()
initialize() list[Event]

Initialize the actor.

Returns:

List of events to add to the event queue.

last_schedule_end_event: MessageScheduledSendCompletedEvent = None
handle_event(mobility: MultiConstellation, event: Event) list[Event]

Handle an event.

Parameters:
  • mobility – The mobility model to handle the event with.

  • event – The event to handle.

Returns:

List of events to add to the event queue.

aggregate(period: float, default_bandwidth: float, bandwidth_per_link=None) dict[Link, dict[Interval, tuple[float, float, float, float]]]

Returns: link to interval period to [average size of queue, total data sent (note something may span across more than one interval so use bandwidth), throughput, bandwidth used ratio]

class dsns.logging.LTPTransmissionLoggingActor

Actor that logs retransmission events over time. Used to compute the number of retransmissions per message.

__init__()
initialize() list[Event]

Initialize the actor.

Returns:

List of events to add to the event queue.

handle_event(mobility: MultiConstellation, event: Event) list[Event]

Handle an event.

Parameters:
  • mobility – The mobility model to handle the event with.

  • event – The event to handle.

Returns:

List of events to add to the event queue.

aggregate(period: float) tuple[dict[LinkMessageID, dict[Interval, int]], dict[LinkMessageID, dict[Interval, int]], dict[LinkMessageID, dict[Interval, int]], dict[LinkMessageID, dict[Interval, int]]]

Returns two dictionaries. First is link and underying message UID to number of transmissions in each interval Second is link and LTP segment UID to number of transmissions in each interval