#four agents with type 6 abstraction process are initialized below with different communication types
agent_6=DoctorAgent("Agent_6",6)#agent_6's communication parameter is set to zero as it does not communicate with the human doctor
agent_7=DoctorAgent("Agent_7",6)#agent_7's communication parameter is also set to zero as it does not communicate with the human doctor, but it can randomly guess one of doctor's abstraction-related beliefs
agent_8=DoctorAgent("Agent_8",6)#agent_8 asks human doctor about one of doctor's abstraction-related beliefs when it performs an unexpected action during a deliberation
agent_9=DoctorAgent("Agent_9",6)#agent_8 asks human doctor about one of doctor's abstraction-related beliefs when it performs an unexpected action during a deliberation
agent_7.guess_type=1
agent_8.communication_type=1
agent_9.communication_type=1
#initialization of agents: abstraction-related beliefs are both assigned to 0
agent_6.add_belief([abss_1,0],0)#agent_6 initialized with no perceived trust from its human partner)
agent_6.add_belief([abss_2,0],0)#meaning abstraction-related beliefs are both assigned to 0
agent_7.add_belief([abss_1,0],0)#agent_6 initialized with no perceived trust from its human partner)
agent_7.add_belief([abss_2,0],0)#meaning abstraction-related beliefs are both assigned to 0
agent_8.add_belief([abss_1,0],0)#agent_6 initialized with no perceived trust from its human partner)
agent_8.add_belief([abss_2,0],0)#meaning abstraction-related beliefs are both assigned to 0
agent_9.add_belief([abss_1,0],0)#agent_6 initialized with no perceived trust from its human partner)
agent_9.add_belief([abss_2,0],0)#meaning abstraction-related beliefs are both assigned to 0
human_1=DoctorHuman("Human_1")#instantiation of four human doctors that are capable of adding/revising their beliefs, holding abstractions, and performing deliberations accordingly
human_2=DoctorHuman("Human_2")#a human doctor can communicate with its agent doctor partner to tell whether a certain action decision of the agent is expected or not
human_3=DoctorHuman("Human_3")#it can also answer questions about its agent partner's beliefs
human_4=DoctorHuman("Human_4")
#initialization of human doctors: abstraction-related beliefs are both assigned to 0
human_1.init_human(0,0)
human_2.init_human(0,0)
human_3.init_human(0,0)
human_4.init_human(0,0)
all_agents_2=[agent_6,agent_7,agent_8,agent_9]
all_humans=[human_1,human_2,human_3,human_4]
forround_sim2inrange(simulation2_duration):
random_event_2=random.randint(
1,3
)#there are three types of events, every event happening with equal probability
#print("")
ifrandom_event_2==1:#ordinary belief can be added to/revised in the beliefbase
#lower-order abstraction-related belief (random_abs_belief_ii) can be added to/revised in humans' beliefbases
#50-50 chance being the same value with the corresponding higher-order abstraction-related belief (random_abs_belief_i)
else:#random_event_2 == 3, deliberation is to be done (i.e., a conflict happens, the agent needs to decide on what to do)
foragent_kkinrange(len(all_agents_2)):
all_agents_2[agent_kk].deliberation(round_sim2)#every agent does deliberation
all_humans[agent_kk].deliberation_critic(all_agents_2[agent_kk].current_deliberation)#every human doctor evaluates its agent doctor partner's action decision
if (all_humans[1].unexpected_agent_action_alert==1andall_agents_2[1].guess_type==1):#if the human has not expected the guessing agent's action (agent 7):
guess_number=random.randint(0,1)#agent randomly chooses which abstraction-related belief to guess
all_agents_2[1].guess_single_belief(guess_number,random.randint(0,1))#agent randomly guesses the abstraction-related belief's value
if (all_humans[2].unexpected_agent_action_alert==1andall_agents_2[2].communication_type==1):#if the human has not expected the singly-communicating agent's action (agent 8):
abs_rel_bel_number=random.randint(0,1)#agent randomly chooses which abstraction-related belief to acquire from human
all_agents_2[2].acquire_single_belief(copy.deepcopy(all_humans[2].beliefbase[abs_rel_bel_number]),abs_rel_bel_number)#agent acquires the chosen abstraction-related belief
if (all_humans[3].unexpected_agent_action_alert==1andall_agents_2[3].communication_type==1):
#if the human has not expected the fully-communicating agent's action (agent 9):
asked_beliefs=all_agents_2[3].alert_reaction()#the agent asks human doctor about abstraction-related beliefs,
answered_beliefs=all_humans[3].tell_belief_values(asked_beliefs)#the human tells the abstraction-related beliefs (with their values),