Skip to content

Contact rate semantics #39

@kris-brown

Description

@kris-brown

"Contact rate" is a concept which is familiar to epidemiologists but doesn't neatly fit into the present "pattern match" based timing of AlgebraicABMs. The phenomenon we want to capture is that, at some frequency for each infected person, they interact with an arbitrary other person. That other person gets infected iff they are susceptible (only under that circumstance is there an infection event).

If we naively try to make the pattern be "S + I", then the rate of (attempted) events is proportional to the number of susceptible people (imagine a simulation with one infected person and a trillion susceptibles).

Thus the idea of a "basis" $b: B \rightarrowtail L$ was introduced to separate the fragment of the pattern which is relevant for timing. However, this fails to have the intended semantics because, although there is an attempted event proportional to infected people, it will succeed if there exists a susceptible person anywhere in the world state, $X$ (as there exists an extension of the match $m: B \rightarrow X$ which factors through $b$).

One way to further refine this idea of a basis is to split it into two components: $B \rightarrowtail B' \rightarrowtail L$. When it comes time to fire the rule (proportional to matches out of $B$), we first arbitrarily extend the match to be from $B'$, and then we demand that the extension to $L$ is a unique one. This has the intended semantics, but complicates the framework by adding more objects and morphisms with subtle semantics to keep track of.

Another way to address this is to 'bite the bullet' and implement #19. A simple wiring diagram program with one Query box and one Rewrite box would be sufficient to express this scenario.

Screenshot 2024-08-28 at 11 36 01 AM

(note this is using Query in a common-but-idiosyncratic way: the standard use is looping through all the possible matches of some particular way of extending the current 'agent' (AKA 'distinguished focus'); however, if we pass through it once and never loop back through it, it has the effect of extending the current agent with an arbitrary choice)

(also, in this scenario, the "input agent" of the rule is I+P (it will only rewrite this particular infected + person pair), but the actual $L$ pattern is I+S. It's important "S" is in the pattern rather than a PAC because we need to delete the 'susceptible token' as part of the rule)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions