source: geniuswebcore/geniusweb/protocol/NegoSettings.py@ 93

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

Refactor to help reusing partiesserver.

File size: 1.3 KB
Line 
1from abc import ABC, abstractmethod
2
3from pyson.JsonSubTypes import JsonSubTypes
4from pyson.JsonTypeInfo import JsonTypeInfo, As, Id
5from tudelft_utilities_logging.Reporter import Reporter
6
7from geniusweb.protocol.NegoProtocol import NegoProtocol
8
9
10@JsonSubTypes( ["geniusweb.protocol.session.saop.SAOPSettings.SAOPSettings",
11 "geniusweb.protocol.session.mopac.MOPACSettings.MOPACSettings",
12 "geniusweb.protocol.session.learn.LearnSettings.LearnSettings" ])
13@JsonTypeInfo(use = Id.NAME, include = As.WRAPPER_OBJECT)
14class NegoSettings(ABC):
15 '''
16 Interface for negotiation settings. A negotiation can be either a single
17 session or a tournament
18 '''
19 @abstractmethod
20 def getMaxRunTime(self) -> float:
21 '''
22 @return the maximum run time (seconds). In deterministic runs this can be
23 an exact number (#sessions * runtime per session) but this
24 interface also allows more random tournament protocols. The
25 protocol should stick closely with the maximum it provides to
26 enable planning of tournaments properly.
27 '''
28
29 @abstractmethod
30 def getProtocol(self, logger:Reporter)->NegoProtocol :
31 '''
32 @param logger the logger where the protocol can log events to.
33 @return an initialized and ready to use {@link NegoProtocol} that can
34 handle this Negotiation.
35 '''
Note: See TracBrowser for help on using the repository browser.