metawards.movers.go_isolate

metawards.movers.go_isolate(network: Union[metawards._network.Network, metawards._networks.Networks], go_from: Union[str, int, List[Union[str, int]]] = None, from_demographic: Union[str, int, List[Union[str, int]]] = None, go_to: Union[str, int, List[Union[str, int]]] = None, to_demographic: Union[str, int, List[Union[str, int]]] = None, self_isolate_stage: Union[List[int], int] = 2, fraction: Union[List[float], float] = 1.0, number: int = None, **kwargs) → None[source]

This go function will move individuals from the “from” demographic(s) to the “to” demographic if they show any signs of infection (the disease stage is greater or equal to ‘self_isolate_stage’. 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)

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”

  • self_isolate_stage (int or List[int]) – The stage of infection an individual must be at before they are moved into this demographic. If a list is passed then this can be multiple stages, e.g. [2, 3] will move at stages 2 and 3. Multiple stages are needed if only a fraction of individuals move.

  • fraction (float or List[float]) – The fraction (percentage) of individuals who are moved from this stage into isolation. If this is a single value then the same fraction applies to all self_isolation_stages. Otherwise, the fraction for self_isolate_stage[i] is fraction[i]

  • 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