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

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

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

Public Member Functions

 Constraints (List< Variable > variables)
 The constructor first calls the super class constructor to define the name of the tag this class represents.
List< ConstraintgetConstraints ()
void create (Auction auction, int methodID, final boolean discsp, final boolean sumDecomposition, boolean intensional)
 This method creates the constraints for this DCOP.

Private Member Functions

String getScope (List< String > varNamesList)
 This method returns the scope of a constraint in String representation.
List< String > getVarNamesFromBids (List< Bid > bidsList)
 This method generates a list of variable names from a list of bids.
List< String > getVarNamesFromBids (List< Bid > bidsList, String ownerID)
 This method generates a list of variable names from a list of bids and an owner name.
List< String > getVarNamesFromGood (Good good, List< Integer > biddersScope, int methodID)
 This method generates a list of variable names from a given good and a list of IDs of the bidders desiring this good.
List< String > getVarNamesFromBidder (Bidder bidder, List< Integer > goodsScope, final int methodID)
 This method generates a list of variable names from a given bidder and a list of IDs of the goods contained in at least one of his bids.
void addEqualityConstraintsOnBids (Bid bid, final boolean intensional)
 This method creates binary equality constraints between the copy of the variable corresponding to the bid held by the bidder, and all of the copies held by each auctioneer whose good the bid contains.
void addEqualityConstraintsOnGoods (Bidder bidder, final boolean intensional)
 This method is used for conversion method 3 and creates binary equality constraints between each variable held by the given bidder and its copy held by the auctioneer whose good the variable is representing.

Private Attributes

List< Constraintconstraints
 List containing the constraints of this DCOP.
List< Variablevariables
 List containing the variables of this DCOP.

Static Private Attributes

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

Detailed Description

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

Author
Andreas Schaedeli

Constructor & Destructor Documentation

◆ Constraints()

frodo2.benchmarks.auctions.xcsp.Constraints.Constraints ( List< Variable > variables)

The constructor first calls the super class constructor to define the name of the tag this class represents.

Then the constraints List is initialized and the variables list is assigned to the instance variable

Parameters
variablesList of this DCOP's variables

References variables.

Member Function Documentation

◆ addEqualityConstraintsOnBids()

void frodo2.benchmarks.auctions.xcsp.Constraints.addEqualityConstraintsOnBids ( Bid bid,
final boolean intensional )
private

This method creates binary equality constraints between the copy of the variable corresponding to the bid held by the bidder, and all of the copies held by each auctioneer whose good the bid contains.

This is used for conversion method 2

Parameters
bidBid for which equality constraints are created
intensionalwhether the constraint should be intensional

References constraints, frodo2.benchmarks.auctions.cats.Bid.getBidder(), frodo2.benchmarks.auctions.cats.Bidder.getBidderID(), frodo2.benchmarks.auctions.cats.Bid.getBidID(), and frodo2.benchmarks.auctions.cats.Bid.getGoodsList().

Referenced by create().

Here is the call graph for this function:

◆ addEqualityConstraintsOnGoods()

void frodo2.benchmarks.auctions.xcsp.Constraints.addEqualityConstraintsOnGoods ( Bidder bidder,
final boolean intensional )
private

This method is used for conversion method 3 and creates binary equality constraints between each variable held by the given bidder and its copy held by the auctioneer whose good the variable is representing.

Parameters
bidderBidder instance
intensionalwhether the constraint should be intensional

References constraints, frodo2.benchmarks.auctions.cats.Bidder.getBidderID(), and frodo2.benchmarks.auctions.xcsp.Instance.getGoodsScopeByBidder().

Referenced by create().

Here is the call graph for this function:

◆ create()

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

This method creates the constraints for this DCOP.

This can be done in three different manners, depending on the method that was chosen at program start.

Parameters
auctionAuction to be transformed to a DCOP
methodIDMethod to be used for transformation to a DCOP
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
Todo
Replace XOR with SUM=1

References addEqualityConstraintsOnBids(), addEqualityConstraintsOnGoods(), constraints, frodo2.benchmarks.auctions.cats.Auction.getBidders(), frodo2.benchmarks.auctions.xcsp.Instance.getBiddersScopeByGood(), frodo2.benchmarks.auctions.cats.Auction.getBids(), frodo2.benchmarks.auctions.cats.Auction.getGoods(), frodo2.benchmarks.auctions.xcsp.Instance.getGoodsScopeByBidder(), getScope(), getVarNamesFromBidder(), getVarNamesFromBids(), getVarNamesFromGood(), and variables.

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

Here is the call graph for this function:

◆ getConstraints()

List< Constraint > frodo2.benchmarks.auctions.xcsp.Constraints.getConstraints ( )
Returns
the constraints

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

◆ getScope()

String frodo2.benchmarks.auctions.xcsp.Constraints.getScope ( List< String > varNamesList)
private

This method returns the scope of a constraint in String representation.

The variable names in the input list are separated by space characters and then the whole string is returned

Parameters
varNamesListList of variable names
Returns
Scope of the constraint in String representation

Referenced by create().

◆ getVarNamesFromBidder()

List< String > frodo2.benchmarks.auctions.xcsp.Constraints.getVarNamesFromBidder ( Bidder bidder,
List< Integer > goodsScope,
final int methodID )
private

This method generates a list of variable names from a given bidder and a list of IDs of the goods contained in at least one of his bids.

The variable names represent the variables held by the bidder, and there is one for every good he desires. This is used for conversion methods 3 and 4.

Parameters
bidderBidder instance
goodsScopeList of IDs of goods contained in at least one bid place by the given bidder
methodIDThe method ID
Returns
List of variable names

References frodo2.benchmarks.auctions.cats.Bidder.getBidderID().

Referenced by create().

Here is the call graph for this function:

◆ getVarNamesFromBids() [1/2]

List< String > frodo2.benchmarks.auctions.xcsp.Constraints.getVarNamesFromBids ( List< Bid > bidsList)
private

This method generates a list of variable names from a list of bids.

This is used for method 1, as we do in this case only have bids as variables, so generating the variable names is trivial (Bid_bidID)

Parameters
bidsListList of bids
Returns
List of variable names

Referenced by create().

◆ getVarNamesFromBids() [2/2]

List< String > frodo2.benchmarks.auctions.xcsp.Constraints.getVarNamesFromBids ( List< Bid > bidsList,
String ownerID )
private

This method generates a list of variable names from a list of bids and an owner name.

This is used for method 2, as there are copies of variables held by different owners, so the owner has to be specified in the variable name. The naming is as follows: Bid_bidID_ownerID.

Parameters
bidsListList of bids
ownerIDOwner of the variable
Returns
List of variable names

◆ getVarNamesFromGood()

List< String > frodo2.benchmarks.auctions.xcsp.Constraints.getVarNamesFromGood ( Good good,
List< Integer > biddersScope,
int methodID )
private

This method generates a list of variable names from a given good and a list of IDs of the bidders desiring this good.

The variable names represent the variables held by the auctioneer, and there is one for every bidder who has placed at least one bid containing the auctioneer's good. This is used for conversion methods 3 and 4.

Parameters
goodGood instance
biddersScopeList of IDs of bidders having placed at least one bid containing the given good
methodID3, 4 or 5
Returns
List of variable names

References frodo2.benchmarks.auctions.cats.Good.getGoodID().

Referenced by create().

Here is the call graph for this function:

Member Data Documentation

◆ constraints

List<Constraint> frodo2.benchmarks.auctions.xcsp.Constraints.constraints
private

List containing the constraints of this DCOP.

Referenced by addEqualityConstraintsOnBids(), addEqualityConstraintsOnGoods(), and create().

◆ serialVersionUID

final long frodo2.benchmarks.auctions.xcsp.Constraints.serialVersionUID = 3312765494020333074L
staticprivate

Classes extending Element should declare a serial Version UID.

◆ variables

List<Variable> frodo2.benchmarks.auctions.xcsp.Constraints.variables
private

List containing the variables of this DCOP.

Referenced by Constraints(), and create().


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