-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunGamePD.java
More file actions
30 lines (25 loc) · 812 Bytes
/
RunGamePD.java
File metadata and controls
30 lines (25 loc) · 812 Bytes
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
package com.masim.gameTheory;
import com.masim.core.CooperationStrategy;
import com.masim.ui.Console;
import com.masim.utils.SimulationFramework;
import jade.core.Agent;
import jade.core.behaviours.TickerBehaviour;
public class RunGamePD extends TickerBehaviour {
Agent _agent;
public RunGamePD(Agent a, long period) {
super(a, period);
_agent = a;
// TODO Auto-generated constructor stub
}
@Override
protected void onTick() {
if (SimulationFramework.currentStrategy == CooperationStrategy.NEGOTIATION) {
if (!PrisonnerDelimmaUtl.getInstance().started)
_agent.addBehaviour(new StartGameBehavior());
else {
if(SimulationFramework.getCurrentEnv().T<=SimulationFramework.getCurrentEnv().getMax_T())
PrisonnerDelimmaUtl.ComputeRewards();
}
}
}
}