|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
This is the main class for converting a CATS (Combinatorial Auctions Test Suite) into a DCOP (Distributed Constraint Optimization Problem). More...
Static Public Member Functions | |
| static void | main (String[] args) |
| The main method first checks the arguments, then parses the source file, converts the problem by the indicated method and finally writes the output file. | |
| static Auction | parseAuction (String sourceFileName) throws FileNotFoundException |
| Parses the description of an auction, in CATS format. | |
| static Document | toXCSP (Auction auction, int methodID) |
| Formulates the input auction as a DCOP or DisCSP in XCSP format. | |
| static Document | toXCSP (Auction auction, int methodID, boolean discsp, boolean sumDecomposition, boolean intensional, boolean minimize) |
| Formulates the input auction as a DCOP or DisCSP in XCSP format. | |
Static Private Member Functions | |
| static boolean | checkArgs (String[] args) |
| static void | displayLicense () |
| This method reads the license from the file LICENSE.txt and displays it if the file exists and can be read. | |
| static void | displayMethods () |
| This method displays a brief description of the three implemented conversion methods. | |
| static void | usage () |
| This method displays a manual indicating how to run the program. | |
| static void | addBid (int bidID, double price, String line) |
| This method is called whenever a line in the source file matches the bid pattern. | |
| static double | findMaxUtility () |
Static Private Attributes | |
| static String | sourceFileName = null |
| Path and name of the source file; parsed from the args array. | |
| static String | outputDir = null |
| Path where the output file should be saved; parsed from the args array. | |
| static int | methodID = 0 |
| ID of the method to be used; parsed from the args array. | |
| static boolean | minimize = false |
| Boolean indicating whether the auction should be transformed into a minimization problem or not. | |
| static boolean | discsp = false |
If true, bid prices should be ignored, and the output should be a pure DisCSP intance. | |
| static boolean | sumDecomposition = false |
Boolean indicating whether sum constraints should be intensional (true) or extensional (false). | |
| static boolean | intensional = false |
| Whether all constraints must be intensional. | |
| static int | nbGoods = -1 |
| Number of goods in the auction. | |
| static HashSet< Good > | goodsWithRP = new HashSet<Good>() |
| List of all goods which already have a reserve price. | |
| static Auction | auction = null |
| Auction instance created from the source file. | |
| static Map< Integer, Bidder > | dummyGoodsToBiddersMap = new HashMap<Integer, Bidder>() |
| Mapping from dummy good number to bidder; assures no dummy good is assigned to two different bidders. | |
| static final Pattern | nbrBidsPattern = Pattern.compile("\\s*bids\\s+(\\d+)\\s*") |
| Pattern to identify the desired number of bids, which may be lower than the actual number of bids. | |
| static final Pattern | goodsPattern = Pattern.compile("\\s*goods\\s+(\\d+)\\s*") |
| Pattern used to identify the \'goods\' line in the source file. | |
| static final Pattern | dummyPattern = Pattern.compile("\\s*dummy\\s+(\\d+)\\s*") |
| Pattern used to identify the \'dummy\' line in the source file. | |
| static final Pattern | bidPattern = Pattern.compile("\\s*(\\d+)\\s+(-?\\d+(\\.\\d*)?)(\\s+-?\\d+)+\\s*#") |
| Pattern used to identify the bids in the source file. | |
This is the main class for converting a CATS (Combinatorial Auctions Test Suite) into a DCOP (Distributed Constraint Optimization Problem).
Three different methods are implemented to do this, corresponding to three different DCOP models for the auction.
|
staticprivate |
This method is called whenever a line in the source file matches the bid pattern.
The bid is then parsed and a Bid object is created and added to the list of bids In case the bid contains any good ID that is greater than or equal to the number of goods, this represents a dummy good. All bids containing the same dummy good were placed by the same bidder. So, for each bid without dummy goods, a new Bidder is created. However, if there are dummy goods, we want to make sure all the bids with the same dummy good are assigned the same bidder, so there is a mapping from dummy good IDs to Bidders. All bidders have to be added to the auction object. Moreover, if the bid value is less than 0, we consider it as reserve price for the good it bids on.
| bidID | Unique ID of the bid |
| price | Utility of the bid |
| line | Line of the source file containing the bid |
References auction, dummyGoodsToBiddersMap, goodsWithRP, methodID, nbGoods, and frodo2.benchmarks.auctions.cats.Bidder.setFake().
Referenced by parseAuction().

|
staticprivate |
| args | Array of arguments |
References discsp, displayLicense(), displayMethods(), intensional, methodID, minimize, outputDir, sourceFileName, and sumDecomposition.
Referenced by main().

|
staticprivate |
This method reads the license from the file LICENSE.txt and displays it if the file exists and can be read.
Referenced by checkArgs().
|
staticprivate |
This method displays a brief description of the three implemented conversion methods.
Referenced by checkArgs().
|
staticprivate |
|
static |
The main method first checks the arguments, then parses the source file, converts the problem by the indicated method and finally writes the output file.
| args | Arguments passed at program start |
References auction, checkArgs(), discsp, intensional, methodID, minimize, outputDir, parseAuction(), sourceFileName, sumDecomposition, toXCSP(), and usage().

|
static |
Parses the description of an auction, in CATS format.
| sourceFileName | the path to the CATS file |
| FileNotFoundException | if the input file is not found |
References addBid(), auction, bidPattern, dummyGoodsToBiddersMap, dummyPattern, goodsPattern, nbGoods, nbrBidsPattern, and sourceFileName.
Referenced by main().

|
static |
Formulates the input auction as a DCOP or DisCSP in XCSP format.
| auction | the auction |
| methodID | the ID of the XCSP modeling method |
References auction, methodID, and toXCSP().
Referenced by main(), and toXCSP().

|
static |
Formulates the input auction as a DCOP or DisCSP in XCSP format.
| auction | the auction |
| methodID | the ID of the XCSP modeling method |
| discsp | whether to only allow hard constraints |
| sumDecomposition | whether to use intensional SUM constraints |
| intensional | whether all constraints should be intensional |
| minimize | whether to output a minimization or a maximization problem |
References auction, frodo2.benchmarks.auctions.xcsp.Instance.create(), discsp, findMaxUtility(), intensional, methodID, minimize, sumDecomposition, and frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.switchMaxMin().

|
staticprivate |
This method displays a manual indicating how to run the program.
Referenced by main().
|
staticprivate |
Auction instance created from the source file.
Referenced by addBid(), findMaxUtility(), main(), parseAuction(), toXCSP(), and toXCSP().
|
staticprivate |
Pattern used to identify the bids in the source file.
Referenced by parseAuction().
|
staticprivate |
If true, bid prices should be ignored, and the output should be a pure DisCSP intance.
Referenced by checkArgs(), findMaxUtility(), main(), and toXCSP().
|
staticprivate |
Mapping from dummy good number to bidder; assures no dummy good is assigned to two different bidders.
Referenced by addBid(), and parseAuction().
|
staticprivate |
Pattern used to identify the \'dummy\' line in the source file.
Referenced by parseAuction().
|
staticprivate |
Pattern used to identify the \'goods\' line in the source file.
Referenced by parseAuction().
|
staticprivate |
List of all goods which already have a reserve price.
Referenced by addBid().
|
staticprivate |
Whether all constraints must be intensional.
Referenced by checkArgs(), main(), and toXCSP().
|
staticprivate |
ID of the method to be used; parsed from the args array.
Referenced by addBid(), checkArgs(), main(), toXCSP(), and toXCSP().
|
staticprivate |
Boolean indicating whether the auction should be transformed into a minimization problem or not.
Referenced by checkArgs(), main(), and toXCSP().
|
staticprivate |
Number of goods in the auction.
Referenced by addBid(), and parseAuction().
|
staticprivate |
Pattern to identify the desired number of bids, which may be lower than the actual number of bids.
Referenced by parseAuction().
|
staticprivate |
Path where the output file should be saved; parsed from the args array.
Referenced by checkArgs(), and main().
|
staticprivate |
Path and name of the source file; parsed from the args array.
Referenced by checkArgs(), main(), and parseAuction().
|
staticprivate |
Boolean indicating whether sum constraints should be intensional (true) or extensional (false).
Referenced by checkArgs(), main(), and toXCSP().