In [1]:
import scotch
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
In [2]:
model = scotch.model('HCVLinTrackSS.json')
In [3]:
scotch.helpers.add_actors_wizard(model)
In [4]:
model.save('HCVLinTrackSS.json')
In [3]:
[t,trace, tracked_events] =scotch.simulate.tauLeap(model,60,1, True)
In [4]:
plt.plot(t,trace)
plt.legend(model.states)
Out[4]:
In [5]:
trace[:,0]
Out[5]:
In [6]:
[statesDict, actorsDict] = scotch.helpers.trackIndividuals(model,tracked_events,t, True,True)
In [17]:
for x in statesDict['I1']:
x.sort()
(key=lambda tup: tup[1])
In [31]:
actorsDict['(1 - eta) * beta_V * khi * I1 * T * (1 - mu)'][0].sort(key = lambda tup: (tup[0],tup[1]))
In [7]:
actorsDict['(1 - eta) * beta_V * khi * I1 * T * (1 - mu)'][0]
Out[7]:
In [26]:
a = sorted(actorsDict['(1 - eta) * beta_V * khi * I1 * T * (1 - mu)'][0], key = lambda tup: tup[0])
x = [b for c in a for b in c]
In [30]:
print(x)
print(a)
In [20]:
trace[:,5]
Out[20]:
In [10]:
[x[50] for x in actorsDict]
In [21]:
[x[0] for x in [actorsDict[x[0]] for x in model.events]]
Out[21]:
In [ ]: