source: geniuswebcore/geniusweb/profile/Profile.py@ 100

Last change on this file since 100 was 100, checked in by ruud, 20 months ago

python installs also wheel to avoid error messages

File size: 1.5 KB
RevLine 
[100]1from abc import ABC
2from typing import Optional
3
4from pyson.JsonSubTypes import JsonSubTypes
5from pyson.JsonTypeInfo import Id, As
6from pyson.JsonTypeInfo import JsonTypeInfo
7
8from geniusweb.issuevalue.Bid import Bid
9from geniusweb.issuevalue.Domain import Domain
10
11
12@JsonTypeInfo(use=Id.NAME, include=As.WRAPPER_OBJECT)
13@JsonSubTypes(["geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace.LinearAdditiveUtilitySpace"])
14class Profile(ABC):
15 '''
16 Profile is a very general object describing how much a {@link Bid} is
17 preferred. "is preferred" can be worked out in different ways, eg by a
18 function "isBetter" that says if bid1 is preferred over bid2, or by assigning
19 utility values to each bid that says how much I like that particular bid. All
20 profiles should be implemented immutable
21 '''
22
23 def getName(self)->str:
24 '''
25 @return the name of this profile. Must be simple name (a-Z, 0-9)
26 '''
27
28 def getDomain(self)->Domain :
29 '''
30 @return the domain in which this profile is defined.
31 '''
32
33 def getReservationBid(self) -> Optional[Bid] :
34 '''
35 @return a (hypothetical) bid that is the best alternative to a
36 non-agreement. Only bids that are equal or better should be
37 accepted. If a negotiation does not reach an agreement, the party
38 can get this offer somewhere else. This replaces the older notion
39 of a "reservation value" and is more general. If None, there is
40 no reservation bid and any agreement is better than no agreement.
41 This bid can be partial.
42 '''
43
Note: See TracBrowser for help on using the repository browser.