Skip to content

gateway_to_gateway

cosmica.comm_link.gateway_to_gateway

__all__ module-attribute

__all__ = ['GatewayToGatewayCommLinkCalculator']

GatewayToGatewayCommLinkCalculator

GatewayToGatewayCommLinkCalculator(
    *,
    gateway_to_gateway_bandwidth: float,
    refractive_index: float = 1.5
)

Bases: MemorylessCommLinkCalculator[Gateway, Gateway]

Calculate gateway-to-gateway communication link performance using great circle distance.

Initialize the gateway-to-gateway communication link calculator.

Source code in src/cosmica/comm_link/gateway_to_gateway.py
19
20
21
22
23
24
25
26
27
def __init__(
    self,
    *,
    gateway_to_gateway_bandwidth: float,
    refractive_index: float = 1.5,
) -> None:
    """Initialize the gateway-to-gateway communication link calculator."""
    self.gateway_to_gateway_bandwidth = gateway_to_gateway_bandwidth
    self.refractive_index = refractive_index

gateway_to_gateway_bandwidth instance-attribute

gateway_to_gateway_bandwidth = gateway_to_gateway_bandwidth

refractive_index instance-attribute

refractive_index = refractive_index

calc

calc(
    edges: Collection[tuple[Gateway, Gateway]],
    *,
    dynamics_data: DynamicsData,
    rng: Generator
) -> dict[tuple[Gateway, Gateway], CommLinkPerformance]

Calculate communication link performance for gateway-to-gateway edges.

Source code in src/cosmica/comm_link/gateway_to_gateway.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def calc(
    self,
    edges: Collection[tuple[Gateway, Gateway]],
    *,
    dynamics_data: DynamicsData,  # noqa: ARG002 For interface compatibility
    rng: np.random.Generator,  # noqa: ARG002 For interface compatibility
) -> dict[tuple[Gateway, Gateway], CommLinkPerformance]:
    """Calculate communication link performance for gateway-to-gateway edges."""
    return {
        edge: self._calc_gateway_to_gateway(
            gateway1=edge[0],
            gateway2=edge[1],
        )
        for edge in edges
    }