source: geniuswebcore/test/geniusweb/partystdio/EmptyParty.py@ 73

Last change on this file since 73 was 73, checked in by Bart Vastenhouw, 3 years ago

Fix for IssueValue hashcode.

File size: 1.3 KB
Line 
1import json
2import logging
3import sys
4from typing import cast, Optional, List
5
6from tudelft_utilities_logging.Reporter import Reporter
7
8from geniusweb.actions.EndNegotiation import EndNegotiation
9from geniusweb.actions.PartyId import PartyId
10from geniusweb.inform.Inform import Inform
11from geniusweb.issuevalue.Bid import Bid
12from geniusweb.party.Capabilities import Capabilities
13from geniusweb.party.DefaultParty import DefaultParty
14
15
16class EmptyParty (DefaultParty):
17 """
18 A empty party just for testing PartyStdio.
19 """
20 def __init__(self, reporter:Reporter):
21 super().__init__(reporter)
22 self.getReporter().log(logging.INFO,"party is initialized")
23 self._lastReceivedBid:Optional[Bid] = None
24 self.received:List[Inform]=[]
25
26 # Override
27 def notifyChange(self, info: Inform):
28 self.getReporter().log(logging.INFO,"received info:"+str(info))
29 self.received.append(info)
30 self.send(EndNegotiation(PartyId('someone')))
31
32 # Override
33 def getCapabilities(self): # -> Capabilities
34 return Capabilities( set([ "SAOP"]), set(['geniusweb.profile.utilityspace.LinearAdditive']))
35
36 # Override
37 def getDescription(self):
38 return "test description"
39
40 # Override
41 def terminate(self):
42 super().terminate()
43
Note: See TracBrowser for help on using the repository browser.