Skip to content

was_exposed_in

Syntax

was_exposed_in(condition, group)

Parameters

condition
A transmissible condition within the model.
group>
A group name.

Returns

1 (true) if the agent was exposed to the given condition within the given group, and 0 (false) otherwise.

Description

This predicate returns 1 (true) if the current agent was exposed to the given condition within the given group. Otherwise, this returns 0 (false). For example, this action could be used to determine in the current agent contracted a FLU condition within a school.

Examples

The following example directs the agent to the next state depending on where the agent contracted a FLU condition.

next_if(SchoolInfection, was_exposed_in(FLU, School))
next_if(WorkInfection, was_exposed_in(FLU, Workplace))
default(OtherInfection)

See Also