Skip to content

Commit ab07cba

Browse files
Merge pull request #201 from jameshughes89/nca-example-fix
📝 🐛 Fix import and object creation for NodeCategoricalAttribute Example
2 parents 4c00666 + 0097f2e commit ab07cba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/custom/compartments/NodeCategoricalAttribute.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ It restrain the rule evaluation to all those nodes for which the attribute "Sex"
4444
import random
4545
import ndlib.models.ModelConfig as mc
4646
import ndlib.models.CompositeModel as gc
47-
import ndlib.models.compartments.NodeCategoricalAttribute as ns
47+
import ndlib.models.compartments as cpm
4848
4949
# Network generation
5050
g = nx.erdos_renyi_graph(1000, 0.1)
@@ -62,7 +62,7 @@ It restrain the rule evaluation to all those nodes for which the attribute "Sex"
6262
model.add_status("Removed")
6363
6464
# Compartment definition
65-
c1 = na.NodeCategoricalAttribute("Sex", "male", probability=0.6)
65+
c1 = cpm.NodeCategoricalAttribute("Sex", "male", probability=0.6)
6666
6767
# Rule definition
6868
model.add_rule("Susceptible", "Infected", c1)

0 commit comments

Comments
 (0)