source: geniuswebcore/geniusweb/protocol/CurrentNegoState.py@ 71

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

LEARN algorithm now also available. Fixed small issues.

File size: 735 bytes
Line 
1import time
2
3from geniusweb.events.CurrentState import CurrentState
4from geniusweb.protocol.NegoState import NegoState
5
6
7class CurrentNegoState (CurrentState):
8 '''
9 Implementation of CurrentState event. This contains NegoState and therefore
10 can not be defined in the events module.
11 '''
12
13 def __init__(self, state:NegoState, now:int=round(1000*time.time())) :
14 super().__init__(now)
15 self._state = state;
16
17
18 def getState(self) -> NegoState:
19 return self._state
20
21
22 def __repr__(self):
23 return "CurrentNegoState[" + str(self.getTime())\
24 + "," + str(self._state) + "]"
25
26 def __hash__(self):
27 return hash((self._state, self._time))
28
29 def __eq__(self, other):
30 return super().__eq__(other) and \
31 self._state==other._state
Note: See TracBrowser for help on using the repository browser.