digital_comms.mobile_network package

Submodules

digital_comms.mobile_network.interventions module

Decide on interventions

digital_comms.mobile_network.interventions.decide_interventions(strategy, budget, service_obligation_capacity, system, timestep)

Given strategy parameters and a system return some next best intervention

Parameters:
  • strategy (str) – One of ‘minimal’, ‘macrocell’, ‘small_cell’ intervention strategies
  • budget (int) – Annual budget in GBP
  • service_obligation_capacity (float) – Threshold for universal mobile service, in Mbps/km^2
  • system (ICTManager) – Gives areas (postcode sectors) with population density, demand
Returns:

0: obj:list of obj:dict

Details of the assets that were built

Each containing the keys

site_ngr: str

Unique site reference number

frequency: str

Asset frequency (“700”, ..)

technology: str

Asset technology (“LTE”, ..)

bandwidth: str

Asset bandwith (“2x10MHz”, ..)

build_date: int

Timestep when the asset was built

pcd_sector: int

Id of the postcode sector where asset is located

1: int

Remaining budget

2: int

Total costs of intervention build step

Return type:

tuple

digital_comms.mobile_network.interventions.meet_demand(budget, available_interventions, timestep, system)
digital_comms.mobile_network.interventions.meet_service_obligation(budget, available_interventions, timestep, service_obligation_capacity, system)

digital_comms.mobile_network.model module

Cambridge Communications Assessment Model

class digital_comms.mobile_network.model.ICTManager(lads, pcd_sectors, assets, capacity_lookup_table, clutter_lookup)

Bases: object

Model controller class.

Represents local area districts and postcode sectors with their assets, capacities and clutters.

Parameters:
  • lads (list of dict) –

    List of local area districts

    • id: int
      Unique ID
    • name: str
      Name of the LAD
  • pcd_sectors (list of dict) –

    List of postcode sectors (pcd)

    • id: str
      Postcode name
    • lad_id: int
      Unique ID
    • population: int
      Number of inhabitants
    • area: int
      Size in TODO
    • user_throughput: int
      TODO
  • assets (list of dict) –

    List of assets

    • pcd_sector: str
      Code of the postcode sector
    • site_ngr: int
      Unique site reference number
    • technology: str
      Abbreviation of the asset technology (LTE, 3G, 4G, ..)
    • frequency: str
      Frequency of the asset (800, 2600, ..)
    • bandwidth: str
      Bandwith of the asset (2x10MHz, ..)
    • build_date: int
      Build year of the asset
  • capacity_lookup_table (dict) –

    Dictionary that represents the capacity of an asset configuration as a function of population density, per district type

    • key: tuple
      • 0: str
        Area type (‘urban’, ..)
      • 1: str
        Frequency of the asset configuration (800, 2600, ..)
      • 2: str
        Bandwith of the asset configuration (2x10MHz, ..)
    • value: list of tuple
      • 0: int
        Population density
      • 1: int
        Capacity
  • clutter_lookup (list of tuple) –

    Each element represents TODO

class digital_comms.mobile_network.model.LAD(data)

Bases: object

Local area district.

Represents an area to be modelled, contains data for demand characterisation and assets for supply assessment.

Parameters:data (dict) –

Metadata and info for the LAD

  • id: int
    Unique ID
  • name: str
    Name of the LAD
add_asset(asset)

Add an asset to postcode sector

Parameters:asset (TODO) – TODO
add_pcd_sector(pcd_sector)

Add a postcode sector to the local area district.

Parameters:pcd_sector (PostcodeSector) – Representation of a postcode sector that needs to be added to the local area district
capacity()

Calculate mean capacity from all nested postcode sectors

Returns:Mean capacity of the local area district
Return type:obj

Notes

Function returns 0 when no postcode sectors are configured to the LAD.

coverage()

Calculate coverage as the proportion of the population able to obtain the specified capacity threshold

Returns:Coverage in the local area district
Return type:obj

Notes

Function returns 0 when no postcode sectors are configured to the LAD.

demand()

Calculate demand per square kilometer (Mbps km^2) from all nested postcode sectors

Returns:Demand of the local area district
Return type:obj

Notes

Function returns 0 when no postcode sectors are configured to the LAD.

population

obj – Sum of all postcode sectors populations in the local area district

population_density

obj – The population density in the local area district

system()

Populates a dict with all existing assets Which in total represents the system.

Returns:TODO
Return type:dict
class digital_comms.mobile_network.model.PostcodeSector(data, assets, capacity_lookup_table, clutter_lookup)

Bases: object

Represents a Postcode sector to be modelled

capacity_margin

obj – Capacity margin per postcode sector in Mbps

demand

obj – The demand in capacity per km^2 TODO Double check

Notes

0.02 Mbps per user during busy hours
  • 100 population
  • 0.8 penetration

/ 10 km^2 area

= ~0.16 Mbps/km^2 area capacity demand

population_density

obj – The population density in persons per square kilometer (km^2)

threshold_demand(SERVICE_OBLIGATION_CAPACITY)

Calculate capacity required to meet a service obligation.

Parameters:SERVICE_OBLIGATION_CAPACITY (int) – The required service obligation in Mb/s
Returns:The threshold demand in Mbps/km^2
Return type:int

Notes

Effectively calculating Mb/s/km^2 from Mb/s/user

E.g.
100 people in this area * 0.8 penetration proportion * 0.3 market share * 2 Mb/s/person service obligation / 10 km^2 area = ~4.8 Mbps/km^2
digital_comms.mobile_network.model.interpolate(x0, y0, x1, y1, x)

Linear interpolation between two values

Parameters:
  • x0 (int) – Lower x-value
  • y0 (int) – Lower y-value
  • x1 (int) – Upper x-value
  • y1 (int) – Upper y-value
  • x (int) – Requested x-value
Returns:

Interpolated y-value

Return type:

int, float

digital_comms.mobile_network.model.lookup_capacity(lookup_table, clutter_environment, frequency, bandwidth, site_density)

Use lookup table to find capacity by clutter environment geotype, frequency, bandwidth and site density

Parameters:
  • lookup_table (dict) – Capacity lookup table
  • clutter_environment (str) – Area type (‘urban’, ..)
  • frequency (str) – Frequency of the asset configuration (800, 2600, ..)
  • bandwidth (str) – Bandwith of the asset configuration (2x10MHz, ..)
  • site_density (int) – The population density in asset area
Returns:

The capacity for the asset in TODO

Return type:

int

Example

>>> lookup_table = {
        ("Urban", "800", "2x10MHz"): [
            (0, 1),
            (1, 2),
        ],
        ("Urban", "2600", "2x10MHz"): [
            (0, 3),
            (3, 5),
        ]
    }
>>> lookup_capacity(lookup_table, "Urban", "2600", "2x10MHz", 3)
    5

Notes

Returns a capacity of 0 when the site density is below the specified range. Interpolates between values between the lower and upper bounds. Returns the maximum capacity when the site density is higher than the uppper bound.

Raises:KeyError – If combination is not found in the lookup table.
digital_comms.mobile_network.model.lookup_clutter_geotype(clutter_lookup, population_density)

Return geotype based on population density

Parameters:
  • clutter_lookup (list of tuple) –

    Lookup table that represents geographical types and their population density sorted by population_density_upper_bound ascending.

    • 0: int
      Population density in persons per square kilometer (p/km^2)
    • 1: str
      Geotype (‘Urban’, ..)
  • population_density (int) – The population density in persons per square kilometer, that needs to be looked up in the clutter lookup table
Returns:

Geotype match for population_density

Return type:

str

Example

>>> clutter_lookup = [
        (5, "Urban")
    ]
>>> lookup_clutter_geotype(clutter_lookup, 0)
    "Urban"

Notes

Returns lowest boundary if population density is lower than the lowest boundary. Returns upper boundary of a region if population density is within a region range. Returns upper boundary if population density is higher than the highest boundary.

digital_comms.mobile_network.model.pairwise(iterable)

Return iterable of 2-tuples in a sliding window

Parameters:iterable (list) – Sliding window
Returns:Iterable of 2-tuples
Return type:list of tuple

Example

>>> list(pairwise([1,2,3,4]))
    [(1,2),(2,3),(3,4)]