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

This class is used to generate the 'relation' tags in the XML output file. More...

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

Public Member Functions

 Relation (String name, String arity, String defaultUtility, Map< Double, List< String > > alternativeAssignments)
 Constructor.
 Relation (String name, String arity, String defaultUtility, Map< Double, List< String > > alternativeAssignments, String semantics)
 Constructor.
void create ()
 This method adds the instance variables as attributes, so they are written to the 'relation' element in the XML output file.

Private Member Functions

String altAssignmentsToString ()
 This method transforms the mapping from utilities to the variable assignments yielding the corresponding utility into a string representation.
String getNbTuples (Map< Double, List< String > > tuples)

Private Attributes

String name
 Name of the relation.
String arity
 Arity of the relation, i.e.
String nbTuples
 Number of tuples that do not take the default utility.
String semantics
 Semantics of the relation; only 'soft' allowed at the moment.
String defaultUtility
 Default utility of the relation.
Map< Double, List< String > > alternativeAssignments
 Mapping of utilities to a list of assignments rewarding that utility (for all assignments not yielding the default utility).

Static Private Attributes

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

Detailed Description

This class is used to generate the 'relation' tags in the XML output file.

Author
Andreas Schaedeli

Constructor & Destructor Documentation

◆ Relation() [1/2]

frodo2.benchmarks.auctions.xcsp.Relation.Relation ( String name,
String arity,
String defaultUtility,
Map< Double, List< String > > alternativeAssignments )

Constructor.

Parameters
nameName of the relation
arityArity of the relation
defaultUtilityDefault utility for all assignments that are not explicitly mentioned
alternativeAssignmentsMapping from utilities to assignments that do not yield default utility

References alternativeAssignments, arity, defaultUtility, and name.

◆ Relation() [2/2]

frodo2.benchmarks.auctions.xcsp.Relation.Relation ( String name,
String arity,
String defaultUtility,
Map< Double, List< String > > alternativeAssignments,
String semantics )

Constructor.

Parameters
nameName of the relation
arityArity of the relation
defaultUtilityDefault utility for all assignments that are not explicitly mentioned
alternativeAssignmentsMapping from utilities to assignments that do not yield default utility
semantics"soft", "supports" or "conflicts"

References alternativeAssignments, arity, defaultUtility, getNbTuples(), name, and semantics.

Here is the call graph for this function:

Member Function Documentation

◆ altAssignmentsToString()

String frodo2.benchmarks.auctions.xcsp.Relation.altAssignmentsToString ( )
private

This method transforms the mapping from utilities to the variable assignments yielding the corresponding utility into a string representation.

The syntax is as follows:
utility1: ass_1|ass_2|...|ass_n|utility2: ass_1|ass_2 etc.

Returns
String representation of alternative assignments

References alternativeAssignments.

Referenced by create().

◆ create()

void frodo2.benchmarks.auctions.xcsp.Relation.create ( )

This method adds the instance variables as attributes, so they are written to the 'relation' element in the XML output file.

To write the alternative assignments, another method is used

References altAssignmentsToString(), arity, defaultUtility, name, nbTuples, and semantics.

Here is the call graph for this function:

◆ getNbTuples()

String frodo2.benchmarks.auctions.xcsp.Relation.getNbTuples ( Map< Double, List< String > > tuples)
private
Parameters
tuplesMapping from values to assignments
Returns
Number of assignments found in the mapping

References nbTuples.

Referenced by Relation().

Member Data Documentation

◆ alternativeAssignments

Map<Double, List<String> > frodo2.benchmarks.auctions.xcsp.Relation.alternativeAssignments
private

Mapping of utilities to a list of assignments rewarding that utility (for all assignments not yielding the default utility).

Referenced by altAssignmentsToString(), Relation(), and Relation().

◆ arity

String frodo2.benchmarks.auctions.xcsp.Relation.arity
private

Arity of the relation, i.e.

number of variables over which the relation spans

Referenced by create(), Relation(), and Relation().

◆ defaultUtility

String frodo2.benchmarks.auctions.xcsp.Relation.defaultUtility
private

Default utility of the relation.

Referenced by create(), Relation(), and Relation().

◆ name

String frodo2.benchmarks.auctions.xcsp.Relation.name
private

Name of the relation.

Referenced by create(), Relation(), and Relation().

◆ nbTuples

String frodo2.benchmarks.auctions.xcsp.Relation.nbTuples
private

Number of tuples that do not take the default utility.

Referenced by create(), and getNbTuples().

◆ semantics

String frodo2.benchmarks.auctions.xcsp.Relation.semantics
private

Semantics of the relation; only 'soft' allowed at the moment.

Referenced by create(), and Relation().

◆ serialVersionUID

final long frodo2.benchmarks.auctions.xcsp.Relation.serialVersionUID = 9169972812415905559L
staticprivate

Classes extending Element should declare a serial Version UID.


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