Initial commit
This commit is contained in:
commit
66a6860316
407 changed files with 1254365 additions and 0 deletions
21
models/seq_activity_synthetic/model.py
Normal file
21
models/seq_activity_synthetic/model.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import sys
|
||||
sys.path.append("../../src/")
|
||||
from DEVS import *
|
||||
|
||||
|
||||
class Generator(AtomicDEVS):
|
||||
def __init__(self, num, ta):
|
||||
AtomicDEVS.__init__(self, "Generator" + str(num))
|
||||
self.state = None
|
||||
self.ta = ta
|
||||
|
||||
def timeAdvance(self):
|
||||
return self.ta
|
||||
|
||||
class StaticModel(CoupledDEVS):
|
||||
def __init__(self, size, actives):
|
||||
CoupledDEVS.__init__(self, "Root")
|
||||
ta_counter = 0
|
||||
for i in range(size):
|
||||
self.addSubModel(Generator(i, 1.0 if ta_counter < actives else float('inf')))
|
||||
ta_counter += 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue