metawards.Node

class metawards.Node(label: int = None, begin_to: int = None, end_to: int = None, self_w: int = None, begin_p: int = None, end_p: int = None, self_p: int = None, day_foi: float = 0.0, night_foi: float = 0.0, weekend_foi: float = 0.0, play_suscept: float = 0.0, save_play_suscept: float = 0.0, denominator_n: float = 0.0, denominator_d: float = 0.0, denominator_p: float = 0.0, denominator_pd: float = 0.0, x: float = 0.0, y: float = 0.0, scale_uv: float = 1.0, cutoff: float = 99999.99, bg_foi: float = 0.0)[source]

This class represents an electoral ward (node) in the network

__init__(label: int = None, begin_to: int = None, end_to: int = None, self_w: int = None, begin_p: int = None, end_p: int = None, self_p: int = None, day_foi: float = 0.0, night_foi: float = 0.0, weekend_foi: float = 0.0, play_suscept: float = 0.0, save_play_suscept: float = 0.0, denominator_n: float = 0.0, denominator_d: float = 0.0, denominator_p: float = 0.0, denominator_pd: float = 0.0, x: float = 0.0, y: float = 0.0, scale_uv: float = 1.0, cutoff: float = 99999.99, bg_foi: float = 0.0) → None

Initialize self. See help(type(self)) for accurate signature.

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(other)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__gt__(value, /)

Return self>value.

__init__([label, begin_to, end_to, self_w, …])

Initialize self.

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object.

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

get_custom(key[, default])

Return the value of the custom parameter at key ‘key’, returning ‘default’ if this doesn’t exist

set_custom(key, value)

Set the value of the custom parameter at key ‘key’ to ‘value’.

Attributes

__annotations__

__dataclass_fields__

__dataclass_params__

__dict__

__doc__

__hash__

__module__

__weakref__

list of weak references to the object (if defined)

_custom_params

The per-ward custom user parameters

begin_p

The index (int) of the first link for this node in the network play Links list (play)

begin_to

The index (int) of the first link for this node in the network Links list

bg_foi

Per-ward background FOI (starting value for FOI calculations)

cutoff

The per-ward cutoff (restrict movement to below this distance in km)

day_foi

denominator_d

denominator_n

denominator_p

denominator_pd

end_p

The number (int) of links for this node in the Links play list

end_to

The number (int) of links for this node in the Links list

label

The node’s label (int).

night_foi

play_suscept

The number of susceptible players in this ward

save_play_suscept

scale_uv

The per-ward scale_uv (amount to scale up or down the FOI

self_p

self_w

weekend_foi

x

x coordinate of the ward (location)

y

y coordinate of the ward (location)

begin_p: int = None

The index (int) of the first link for this node in the network play Links list (play)

begin_to: int = None

The index (int) of the first link for this node in the network Links list

bg_foi: float = 0.0

Per-ward background FOI (starting value for FOI calculations)

cutoff: float = 99999.99

The per-ward cutoff (restrict movement to below this distance in km)

end_p: int = None

The number (int) of links for this node in the Links play list

end_to: int = None

The number (int) of links for this node in the Links list

get_custom(key: str, default: float = 0.0) → float[source]

Return the value of the custom parameter at key ‘key’, returning ‘default’ if this doesn’t exist

label: int = None

The node’s label (int). This is the index of the node, which must run from 1 up to len(nodes). A value of -1 implies a null node

play_suscept: float = 0.0

The number of susceptible players in this ward

scale_uv: float = 1.0

The per-ward scale_uv (amount to scale up or down the FOI

set_custom(key: str, value: float) → None[source]

Set the value of the custom parameter at key ‘key’ to ‘value’. Note that this must be a floating point value, or something that can be converted to a float

x: float = 0.0

x coordinate of the ward (location)

y: float = 0.0

y coordinate of the ward (location)