metawards.Node
- class metawards.Node(label: Optional[int] = None, begin_to: Optional[int] = None, end_to: Optional[int] = None, self_w: Optional[int] = None, begin_p: Optional[int] = None, end_p: Optional[int] = None, self_p: Optional[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: Optional[int] = None, begin_to: Optional[int] = None, end_to: Optional[int] = None, self_w: Optional[int] = None, begin_p: Optional[int] = None, end_p: Optional[int] = None, self_p: Optional[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
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, ...])__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)__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____module____weakref__list of weak references to the object (if defined)
_custom_paramsThe per-ward custom user parameters
The index (int) of the first link for this node in the network play Links list (play)
The index (int) of the first link for this node in the network Links list
Per-ward background FOI (starting value for FOI calculations)
The per-ward cutoff (restrict movement to below this distance in km)
day_foidenominator_ddenominator_ndenominator_pdenominator_pdThe number (int) of links for this node in the Links play list
The number (int) of links for this node in the Links list
The node's label (int).
night_foiThe number of susceptible players in this ward
save_play_susceptThe per-ward scale_uv (amount to scale up or down the FOI
self_pself_wweekend_foix coordinate of the ward (location)
y coordinate of the ward (location)
- __eq__(other)
Return self==value.
- __hash__ = None
- __init__(label: Optional[int] = None, begin_to: Optional[int] = None, end_to: Optional[int] = None, self_w: Optional[int] = None, begin_p: Optional[int] = None, end_p: Optional[int] = None, self_p: Optional[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
- __repr__()
Return repr(self).
- 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)