FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.benchmarks.auctions.xcsp.Relations Class Reference

This class is used to generate the 'relations' tag in the XML output file. More...

Inheritance diagram for frodo2.benchmarks.auctions.xcsp.Relations:

Public Member Functions

 Relations ()
 The constructor first calls the super class constructor to define the name of the tag this class represents, then initializes an empty list of relations.
void create (Auction auction, int methodID, boolean discsp, boolean sumDecomposition, boolean intensional)
 This method creates the relations of this DCOP.
List< RelationgetRelations ()

Package Attributes

List< Relationrelations
 List of relations.

Private Member Functions

List< String > createSUMAssignments (int nbVariables, boolean xor)
 This method constructs a list of strings that represent all assignments of the specified number of variables where the SUM relation has utility 0, i.e.
Map< Double, List< String > > createConstantUtilityMapping (double utility, List< String > assignments)
Map< Double, List< String > > createUtilityMappingByBidder (Bidder bidder, List< Integer > goodsScope, final boolean discsp)
 This method creates a mapping from utilities to the corresponding variable assignments.
List< Integer > getGoodIDsForBid (Bid bid)

Static Private Attributes

static final long serialVersionUID = 7080885614966779031L
 Classes extending Element should declare a serial Version UID.

Detailed Description

This class is used to generate the 'relations' tag in the XML output file.

Author
Andreas Schaedeli

Constructor & Destructor Documentation

◆ Relations()

frodo2.benchmarks.auctions.xcsp.Relations.Relations ( )

The constructor first calls the super class constructor to define the name of the tag this class represents, then initializes an empty list of relations.

References relations.

Member Function Documentation

◆ create()

void frodo2.benchmarks.auctions.xcsp.Relations.create ( Auction auction,
int methodID,
boolean discsp,
boolean sumDecomposition,
boolean intensional )

This method creates the relations of this DCOP.

The number and type of the relations depend on the method, therefore a switch is needed. The generated relations are then added as content to this element, so they will be written inside the 'relations' tag. The number of relations is added as a simple attribute

Parameters
auctionAuction instance
methodIDID of conversion method to be applied
discspwhether bid prices should be ignored, and the output should be a pure DisCSP instance
sumDecompositiontrue if sum constraints should be intensional instead of extensional
intensionalwhether all constraints should be intensional
Todo
Replace XOR with SUM=1

References createConstantUtilityMapping(), createSUMAssignments(), createUtilityMappingByBidder(), frodo2.benchmarks.auctions.xcsp.Instance.findMaxConstraintArity(), frodo2.benchmarks.auctions.cats.Auction.getBidders(), frodo2.benchmarks.auctions.cats.Auction.getBids(), frodo2.benchmarks.auctions.xcsp.Instance.getGoodsScopeByBidder(), and relations.

Referenced by frodo2.benchmarks.auctions.xcsp.Instance.create().

Here is the call graph for this function:

◆ createConstantUtilityMapping()

Map< Double, List< String > > frodo2.benchmarks.auctions.xcsp.Relations.createConstantUtilityMapping ( double utility,
List< String > assignments )
private
Parameters
utilityConstant utility for all assignments
assignmentsList of variable Assignments yielding the same utility
Returns
Mapping from constant utility to assignments

Referenced by create().

◆ createSUMAssignments()

List< String > frodo2.benchmarks.auctions.xcsp.Relations.createSUMAssignments ( int nbVariables,
boolean xor )
private

This method constructs a list of strings that represent all assignments of the specified number of variables where the SUM relation has utility 0, i.e.

all assignments where the sum of all variable values is <= 1

Parameters
nbVariablesNumber of variables between which the SUM relation should be created
xorif true, the tuple full of zero is forbidden
Returns
List of Strings containing all accepted assignments

Referenced by create().

◆ createUtilityMappingByBidder()

Map< Double, List< String > > frodo2.benchmarks.auctions.xcsp.Relations.createUtilityMappingByBidder ( Bidder bidder,
List< Integer > goodsScope,
final boolean discsp )
private

This method creates a mapping from utilities to the corresponding variable assignments.

For each bid, the utility is rewarded if and only if each variable standing for a good contained in the bid is 1, and all the others are 0 (a bidder wants to win only one of his bids). A first exception is the all 0 string; in this case, the reward is 0. The second exception is the fake bids; in this case, the utility is rewarded if and only if each variable is 0 (it does not win the bid = the good is sold).

Parameters
bidderBidder instance
goodsScopeList of IDs of all the goods the bidder has placed a bid for
discspwhether bid prices should be ignored, and the output should be a pure DisCSP instance
Returns
Mapping from utilities to corresponding assignments; usually one utility to one assignment per bid

References frodo2.benchmarks.auctions.cats.Bidder.getBidsList(), and getGoodIDsForBid().

Referenced by create().

Here is the call graph for this function:

◆ getGoodIDsForBid()

List< Integer > frodo2.benchmarks.auctions.xcsp.Relations.getGoodIDsForBid ( Bid bid)
private
Parameters
bidBid instance
Returns
List of IDs of goods contained in the given bid

References frodo2.benchmarks.auctions.cats.Bid.getGoodsList().

Referenced by createUtilityMappingByBidder().

Here is the call graph for this function:

◆ getRelations()

List< Relation > frodo2.benchmarks.auctions.xcsp.Relations.getRelations ( )
Returns
List of generated relations

References relations.

Member Data Documentation

◆ relations

List<Relation> frodo2.benchmarks.auctions.xcsp.Relations.relations
package

List of relations.

Referenced by create(), getRelations(), and Relations().

◆ serialVersionUID

final long frodo2.benchmarks.auctions.xcsp.Relations.serialVersionUID = 7080885614966779031L
staticprivate

Classes extending Element should declare a serial Version UID.


The documentation for this class was generated from the following file: