|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
This class is used to generate the 'constraints' tag in the output XML file. More...

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< Constraint > | getConstraints () |
| 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< Constraint > | constraints |
| List containing the constraints of this DCOP. | |
| List< Variable > | variables |
| List containing the variables of this DCOP. | |
Static Private Attributes | |
| static final long | serialVersionUID = 3312765494020333074L |
| Classes extending Element should declare a serial Version UID. | |
This class is used to generate the 'constraints' tag in the output XML file.
| 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
| variables | List of this DCOP's variables |
References variables.
|
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
| bid | Bid for which equality constraints are created |
| intensional | whether 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().

|
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.
| bidder | Bidder instance |
| intensional | whether the constraint should be intensional |
References constraints, frodo2.benchmarks.auctions.cats.Bidder.getBidderID(), and frodo2.benchmarks.auctions.xcsp.Instance.getGoodsScopeByBidder().
Referenced by 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.
| auction | Auction to be transformed to a DCOP |
| methodID | Method to be used for transformation to a DCOP |
| discsp | whether bid prices should be ignored, and the output should be a pure DisCSP instance |
| sumDecomposition | true if sum constraints should be intensional instead of extensional |
| intensional | whether all constraints should be intensional |
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().

| List< Constraint > frodo2.benchmarks.auctions.xcsp.Constraints.getConstraints | ( | ) |
Referenced by frodo2.benchmarks.auctions.xcsp.Instance.create().
|
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
| varNamesList | List of variable names |
Referenced by create().
|
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.
| bidder | Bidder instance |
| goodsScope | List of IDs of goods contained in at least one bid place by the given bidder |
| methodID | The method ID |
References frodo2.benchmarks.auctions.cats.Bidder.getBidderID().
Referenced by create().

|
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)
| bidsList | List of bids |
Referenced by create().
|
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.
| bidsList | List of bids |
| ownerID | Owner of the variable |
|
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.
| good | Good instance |
| biddersScope | List of IDs of bidders having placed at least one bid containing the given good |
| methodID | 3, 4 or 5 |
References frodo2.benchmarks.auctions.cats.Good.getGoodID().
Referenced by create().

|
private |
List containing the constraints of this DCOP.
Referenced by addEqualityConstraintsOnBids(), addEqualityConstraintsOnGoods(), and create().
|
staticprivate |
Classes extending Element should declare a serial Version UID.
|
private |
List containing the variables of this DCOP.
Referenced by Constraints(), and create().