metawards.movers.go_stage
- metawards.movers.go_stage(go_from: Optional[Union[str, int, List[Union[str, int]]]] = None, from_demographic: Optional[Union[str, int, List[Union[str, int]]]] = None, go_to: Optional[Union[str, int, List[Union[str, int]]]] = None, to_demographic: Optional[Union[str, int, List[Union[str, int]]]] = None, from_stage: Optional[Union[str, int, List[Union[str, int]]]] = None, to_stage: Optional[Union[str, int, List[Union[str, int]]]] = None, fraction: float = 1.0, number: Optional[int] = None, **kwargs) None [source]
This go function will move individuals from the “go_from” demographic(s) to the “go_to” demographic, as well as the ‘from_stage’ disease stage(s) to the ‘to_stage’ diseaes stage(s).
This can move a subset of individuals if ‘fraction’ is less than 1, e.g. 0.5 would move 50% of individuals (chosen using a random binomial distribution). You can also specify the maximum number of individuals to move per ward by specifying the ‘number’ parameters
- Parameters
go_from (int, str or list of int / str) – The ID(s) of the demographic(s) to move from. This is the old parameter name used to maintain backwards compatibility. Prefer to use from_demo if you can
go_to (int, str or list of int / str) – The ID(s) of the demographic(s) to move to. This is the old parameter name used to maintain backwards compatibility. Prefer to use to_demo if you can
from_demographic (int, str or list of int / str) – The ID(s) of the demographic(s) to move from. This can be either a single demographic (identified by an integer ID or string), a list of demographics, or, if None, then all demographics.
to_demographic (int, str or list of int / str) – The ID(s) of the demographic to move to. This can be either a single demographic (identified by an integer ID or string), a list of demographics, or, if None, then all demographics. If this is not set, then it is equal to “from_demo”
from_stage (int, str or list of int / str) – The ID(s) of the disease stage(s) to move from. This can be either a single stage (identified by an integer ID or string), a list of stages, or, if None, then all stages.
to_stage (int, str or list of int / str) – The ID(s) of the disease stage(s) to move to. This can be either a single stage (identified by an integer ID or string), a list of stages, or, if None, then all stages. If this is not set, then it is equal to “from_stage”
fraction (float) – The fraction of individuals in each ward to move, e.g. 0.75 would move 75% of the individuals in a ward / ward-link. By default 100% are moved.
number (int) – The maximum number of individuals in each ward / ward-link to move. The fraction is taken from min(number, number_in_ward). By default all individuals in a ward / ward-link are sampled.
**kwargs – This calls go_ward, so any options that are acceptible to go_ward (with the exception of ‘generator’) can be passed here too