-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create BinaryVariable state object #30
Comments
Categorical variable? |
If I wanted to create a model of, for example, house to house transmission where each agent's current house belongs to a discrete set where all possible combinations of infection states and houses are possible "states" for the agent, I should wait for this update? |
Currently it's only possible using a few contains_susceptible = individual::Variable$new(house, rep(0, population))
contains_infected = individual::Variable$new(house, rep(0, population))
contains_recovered = individual::Variable$new(house, rep(0, population))
process <- function(api) {
# do something with houses which have susceptible and infected
both <- (api$get_variable(house, contains_susceptible) == 1) & (api$get_variable(house, contains_infected) == 1)
...
} This is not ideal. It sounds like this issue would suit you better but I can't give an estimate on when that will be available. |
Is this something I could help out with? It looks like this is a special case of issue #47 that you mentioned, maybe something like |
Ok great! So we intend Categorical is going to be introduced in #46, currently WIP on feat/variable_refactor. It's not fully tested and documented yet though :/ If you're keen to use MultiCategory now, you could branch off of feat/variable_refactor and implement MultiCategory. We could then it in once the refactor is complete. I have added some extra TODO notes on #47 if you want to go down that route. |
Oh cool, that's very clear! Thanks for pointing me to the extra notes on #47, I'll need to study the refactored API a bit before starting those. |
Models often include binary variables that are not mutually exclusive (like State objects). These are currently modelled with Variables using 1 and 0. Investigate and integrate performant alternatives.
The text was updated successfully, but these errors were encountered: