-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain_test.py
67 lines (48 loc) · 2.02 KB
/
main_test.py
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import numpy as np
import matplotlib.pyplot as plt
import sys
import logging
import time
from loguru import logger
from genius_template_importer import import_template
from bidding import generate_bids
from helpers import is_pareto_efficient
from bid import Bid
from utility_space import UtilitySpace
from timeline import Timeline
from agent import JinnAgent
from matplot_analyzer import MatplotAgent
from jinn_timeagent import TimeAgent
from jinn_agents import ConcederAgent, BoulwareAgent, Tit4TatRelativeAgent
NEGOTIATION_TIME = 60
if __name__ == "__main__":
template1 = import_template("templates/Camera/camera_buyer_utility.xml")
template2 = import_template("templates/Camera/camera_seller_utility.xml")
us_buyer = UtilitySpace(template1)
us_seller = UtilitySpace(template2)
tl = Timeline(NEGOTIATION_TIME)
tab = TimeAgent('ta_buyer@localhost', 'aaa', 'TA Buyer', us_buyer, tl)
#tas = TimeAgent('[email protected]', 'aaa', 'TA Seller', us_seller, tl)
#tas = ConcederAgent('[email protected]', 'aaa', 'TA Seller', us_seller, tl)
#tas = BoulwareAgent('[email protected]', 'aaa', 'TA Seller', us_seller, tl)
tas = Tit4TatRelativeAgent('ta_seller@localhost', 'aaa', 'TA Seller', us_seller, tl)
analyzer_agent = MatplotAgent('analyzer@localhost', 'secret',
'ta_buyer@localhost', us_buyer, 'ta_seller@localhost', us_seller)
analyzer_agent.start()
# tab = TimeAgent('ta_buyer@localhost', 'aaa', 'TA Buyer', us_buyer, tl)
# tas = TimeAgent('ta_seller@localhost', 'aaa', 'TA Seller', us_seller, tl)
tab.set_analyzer('analyzer@localhost')
tas.set_analyzer('analyzer@localhost')
JinnAgent.set_opponents(tab, tas)
time.sleep(1)
futureb = tab.start()
futures = tas.start()
futureb.result()
futures.result()
verbose = 0
if verbose > 0:
logger.remove()
logger.add(sys.stderr, level="DEBUG")
else:
logger.remove()
logger.add(sys.stderr, level="INFO")