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

Last change on this file since 69 was 69, checked in by Wouter Pasman, 3 years ago

Added MOPAC protocol. For GeniusWeb 2.0.3

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