-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSystem.py
More file actions
47 lines (37 loc) · 1.43 KB
/
System.py
File metadata and controls
47 lines (37 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class System(object):
def __init__(self,id,position,charge,max_system_charge=10**6):
self.id = id
self.charge= charge #0-1M reourcse
self.position = position #position in the galaxy
self.max_system_charge=max_system_charge
self.agent_ids = [] #index of number of agents inside of the system
self.agent_stats = {"replicate":0,"death":0,"stay":0,"visit":0,"recharge":0} # replicate counts, death counts, stay counts, visit counts, recharge count
def sychronize(self):
#combine all information pick
#need to finish
#ProbeBeliefs =[a.system_beliefs for a in self.agents]
pass
def moveout(self,agentid):
self.agents.pop(self.agents.index(agentid))
def movein(self,agentid):
self.agents.append(agentid)
self.agentrecord["visit"]+=1
def replicate(self,agentid):
self.agentrecord["replicate"]+=1
def death(self,agentid):
self.agentrecord["death"]+=1
def stay(self,agentid):
self.agentrecord["stay"]+=1
def recharge(self,agentid):
self.agentrecord["recharge"]+=1
def getInfo():
return {"id":self.id,
"charge":self.charge,
"position":self.position,
"agent_ids":self.agent_ids,
"agent_stats":self.agent_stats}
def record(self):
pass
def reset(self):
self.agents = []
self.agentrecord = {}