mirror of https://github.com/vacp2p/research.git
change random seed pulsating
This commit is contained in:
parent
7f86cf2bd0
commit
bec7dad7ec
|
@ -45,8 +45,7 @@ class Node():
|
||||||
if (self.name == 'A'):
|
if (self.name == 'A'):
|
||||||
self.randomSeed = 0
|
self.randomSeed = 0
|
||||||
elif (self.name == 'B'):
|
elif (self.name == 'B'):
|
||||||
# NOTE: if 5 then online never overlap, 4=some overlap, 1=a lot
|
self.randomSeed = 1
|
||||||
self.randomSeed = 5
|
|
||||||
else:
|
else:
|
||||||
self.randomSeed = random.randint(1,10)
|
self.randomSeed = random.randint(1,10)
|
||||||
|
|
||||||
|
@ -355,8 +354,9 @@ class Node():
|
||||||
#log("-" * 60)
|
#log("-" * 60)
|
||||||
|
|
||||||
def update_availability(self):
|
def update_availability(self):
|
||||||
arr = [1, 1, 1, 1, 1, 0, 0, 0, 0, 0]
|
#arr = [1, 1, 1, 1, 1, 0, 0, 0, 0, 0]
|
||||||
idx = (self.time + self.randomSeed) % 10
|
arr = [1, 1, 0, 0, 1, 1, 0, 0]
|
||||||
|
idx = (self.time + self.randomSeed) % 8 # 10
|
||||||
self.reliability = arr[idx]
|
self.reliability = arr[idx]
|
||||||
# XXX conflating these for now, depends on POV/agency
|
# XXX conflating these for now, depends on POV/agency
|
||||||
self.availability = arr[idx]
|
self.availability = arr[idx]
|
||||||
|
@ -468,7 +468,7 @@ def run(steps=10):
|
||||||
b.share("A")
|
b.share("A")
|
||||||
|
|
||||||
# C and D participating
|
# C and D participating
|
||||||
a.share("C")
|
# a.share("C")
|
||||||
b.share("D")
|
b.share("D")
|
||||||
c.share("A")
|
c.share("A")
|
||||||
c.share("D")
|
c.share("D")
|
||||||
|
|
Loading…
Reference in New Issue