public class AdditiveUtilitySpace extends AbstractUtilitySpace
fileName
Constructor and Description |
---|
AdditiveUtilitySpace()
Creates an empty utility space.
|
AdditiveUtilitySpace(AdditiveUtilitySpace us)
Copies the data from another UtilitySpace.
|
AdditiveUtilitySpace(Domain domain)
Creates a new utilityspace of the given domain.
|
AdditiveUtilitySpace(Domain domain,
java.util.Map<Objective,Evaluator> fEvaluators) |
AdditiveUtilitySpace(Domain domain,
java.lang.String fileName)
Create new default util space for a given domain.
|
Modifier and Type | Method and Description |
---|---|
Evaluator |
addEvaluator(Objective obj,
Evaluator ev)
Sets an
|
UtilitySpace |
copy() |
boolean |
equals(java.lang.Object obj)
Classes must implement equals.
|
double |
getEvaluation(int pIssueIndex,
Bid bid)
Returns the utility of one issue in the bid.
|
Evaluator |
getEvaluator(int index)
Returns the evaluator of an issue for the given index.
|
java.util.Set<java.util.Map.Entry<Objective,Evaluator>> |
getEvaluators() |
Objective |
getIssue(int index)
Deprecated.
Use getObjective
|
int |
getNrOfEvaluators() |
double |
getUtility(Bid bid) |
double |
getWeight(int issueID) |
java.lang.String |
isComplete()
Check if this utility space is complete and ready for negotiation.
|
boolean |
lock(Objective obj)
Place a lock on the weight of an objective or issue.
|
java.util.Set<java.util.Map.Entry<Objective,Evaluator>> |
normalizeChildren(Objective obj)
Normalizes the weights of objectives of the given objective so that they
sum up to one.
|
protected void |
normalizeWeights(Objective currentRoot) |
double |
setWeight(Objective objective,
double weight)
Method used to set the weight of the given objective.
|
java.lang.String |
toString() |
SimpleElement |
toXML()
Creates an xml representation (in the form of a SimpleElements) of the
utilityspace.
|
boolean |
unlock(Objective obj)
Clear a lock on the weight of an objective or issue.
|
checkReadyForNegotiation, discount, getDiscountFactor, getDomain, getFileName, getMaxUtilityBid, getMinUtilityBid, getReservationValue, getReservationValueUndiscounted, getReservationValueWithDiscount, getReservationValueWithDiscount, getUtilityWithDiscount, getUtilityWithDiscount, isDiscounted, setDiscount, setReservationValue, validateDiscount
public AdditiveUtilitySpace()
public AdditiveUtilitySpace(Domain domain)
domain
- for which the utilityspace should be specified.public AdditiveUtilitySpace(Domain domain, java.util.Map<Objective,Evaluator> fEvaluators)
public AdditiveUtilitySpace(Domain domain, java.lang.String fileName) throws java.lang.Exception
domain
- fileName
- to read domain from. Set fileName to "" if no file available,
in which case default evaluators are loaded..java.lang.Exception
- if error occurs, e.g. if domain does not match the util
space, or file not found.public AdditiveUtilitySpace(AdditiveUtilitySpace us)
us
- utility space to be cloned.protected void normalizeWeights(Objective currentRoot)
public final int getNrOfEvaluators()
public Evaluator getEvaluator(int index)
index
- The IDnumber of the Objective or Issuepublic double getUtility(Bid bid)
bid
- of which we are interested in its utility.UtilitySpace.discount(double, double)
.public final double getEvaluation(int pIssueIndex, Bid bid)
pIssueIndex
- of the issue.bid
- java.lang.Exception
- if the bid or value is null.public double getWeight(int issueID)
issueID
- The Issue or Objective to get the weight frompublic double setWeight(Objective objective, double weight)
objective
- of which the weights must be set.weight
- to which the weight of the objective must be set.public final Objective getIssue(int index)
index
- The index of the issue topublic final Evaluator addEvaluator(Objective obj, Evaluator ev)
obj
- The Objective to attach an Evaluator to.ev
- The Evaluator to attach.public final java.util.Set<java.util.Map.Entry<Objective,Evaluator>> getEvaluators()
public final boolean lock(Objective obj)
obj
- The objective or issue that is about to have it's weight
locked.true
if successful, false
If the
objective doesn't have an evaluator yet.public final boolean unlock(Objective obj)
obj
- The objective or issue that is having it's lock cleared.true
If the lock is cleared, false
if
the objective or issue doesn't have an evaluator yet.public final java.util.Set<java.util.Map.Entry<Objective,Evaluator>> normalizeChildren(Objective obj)
obj
- of which the weights must be normalized.public SimpleElement toXML() throws java.io.IOException
UtilitySpace
null
when
there was an error.java.io.IOException
public java.lang.String isComplete()
UtilitySpace
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
UtilitySpace
equals
in interface UtilitySpace
equals
in class java.lang.Object
obj
- the object to compare withpublic UtilitySpace copy()