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