partage
Class ComplexInstance

java.lang.Object
  extended by partage.ComplexInstance
All Implemented Interfaces:
Instance

public class ComplexInstance
extends java.lang.Object
implements Instance

This class describes an instance of a resource allocation problem with logical preferences and constraints.

Version:
July 2007
Author:
Sylvain Bouveret,

Nested Class Summary
static class ComplexInstance.AbstractIntegerAggregator
          This static abstract class represents an aggregation operator for aggregating weights into individual utilities, and individual utilities into collective utility.
static interface ComplexInstance.Constraint
          A generic interface for representing the constraints.
static class ComplexInstance.GenericObjectAgentFormula
          A static class representing a generic propositional formula made of an array of subformulae, and a logical operator, on the set of alloc(object, agent).
static class ComplexInstance.GenericObjectFormula
          A static class representing a generic propositional formula made of an array of subformulae, and a logical operator, on the set of objects.
static class ComplexInstance.LogicalConstraint
          A static class implementing a constraint expressed on the propositional language over the variables alloc(object, agent).
static interface ComplexInstance.LogicalObjectAgentFormula
          A static interface representing any propositional formula over the set of alloc(o,i) (the set of propositional variables representing the allocation of objects o to agents i).
static interface ComplexInstance.LogicalObjectFormula
          A static interface representing any propositional formula over the set of objects.
static class ComplexInstance.MaxAggregator
          An implementation of a real aggregator which computes the max of the weights.
static class ComplexInstance.MinAggregator
          An implementation of a real aggregator which computes the min of the weights.
static class ComplexInstance.ObjectAgentAtom
          A static class representing an atomic propositional variable (i.e. an alloc(object, agent)).
static class ComplexInstance.ObjectAgentClause
          A static class representing a clause of litterals alloc(o,i) or not(alloc(o,i)).
static class ComplexInstance.ObjectAgentDNF
          A static class representing a propositional logical formula of alloc(o, i) in disjunctive normal form (allows for a more efficient processing of this kind of preferences).
static class ComplexInstance.ObjectAtom
          A static class representing an atomic propositional variable (i.e. an object).
static class ComplexInstance.ObjectCNF
          A static class representing a propositional logical formula of objects in conjunctive normal form (allows for a more efficient processing of this kind of preferences).
static class ComplexInstance.ObjectDNF
          A static class representing a propositional logical formula of objects in disjunctive normal form (allows for a more efficient processing of this kind of preferences).
static class ComplexInstance.PreemptionConstraint
          A static class implementing the Preemption constraint on a set of objects.
static class ComplexInstance.SumAggregator
          An implementation of a real aggregator which computes the sum of the weights.
static class ComplexInstance.VolumeConstraint
          A static class implementing the Volume constraint on a set of objects.
static class ComplexInstance.WeightedLogicalObjectFormula
          A static class implementing a weighted propositional formula (for representing the agents' preferences)
 
Field Summary
 ComplexInstance.AbstractIntegerAggregator collectiveAggregator
          The operator aggregating weights into collective utilities
 ComplexInstance.AbstractIntegerAggregator individualAggregator
          The operator aggregating weights into individual utilities
 
Constructor Summary
ComplexInstance(int _nA, int _nO, java.lang.String _name)
          Constructs an instance of the resource allocation problem with logical preferences and constraints.
 
Method Summary
 void addConstraint(ComplexInstance.Constraint c)
           
 void addPref(int agent, ComplexInstance.WeightedLogicalObjectFormula f)
          Adds a preference formula to an agent.
 java.util.ArrayList<ComplexInstance.Constraint> getConstraints()
          The getter to the list of constraints.
 int getNA()
           
 java.lang.String getName()
          returns the name of the instance.
 int getNO()
           
 java.util.ArrayList<ComplexInstance.WeightedLogicalObjectFormula> getPrefs(int i)
          The getter to the preferences of a given agent.
 int getValMaxCollectiveUtility()
           
 int getValMaxIndividualUtility()
           
 java.lang.String pretty()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

individualAggregator

public ComplexInstance.AbstractIntegerAggregator individualAggregator
The operator aggregating weights into individual utilities


collectiveAggregator

public ComplexInstance.AbstractIntegerAggregator collectiveAggregator
The operator aggregating weights into collective utilities

Constructor Detail

ComplexInstance

public ComplexInstance(int _nA,
                       int _nO,
                       java.lang.String _name)
Constructs an instance of the resource allocation problem with logical preferences and constraints. Initially the set of preferences and constraints are empty. Notice that the agents and objects are numbered from 1 (and not from 0).

Parameters:
_nA - the number of agents of the instance.
_nO - the number of objects of the instance.
_name - the name of the instance.
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Instance
returns the name of the instance.

Specified by:
getName in interface Instance
Returns:
the name of the instance

addPref

public void addPref(int agent,
                    ComplexInstance.WeightedLogicalObjectFormula f)
Adds a preference formula to an agent. This method automatically checks if the agent number is valid, and if the formula does not contain any invalid number.

Parameters:
agent - the agent whose preferences will be modified.
f - the formula to add to the agents preferences.

addConstraint

public void addConstraint(ComplexInstance.Constraint c)

getPrefs

public java.util.ArrayList<ComplexInstance.WeightedLogicalObjectFormula> getPrefs(int i)
The getter to the preferences of a given agent.

Parameters:
i - the number of the agents whose preferences we want.
Returns:
the preferences of the agents (given by a list of weighted boolean formulae).

getConstraints

public java.util.ArrayList<ComplexInstance.Constraint> getConstraints()
The getter to the list of constraints.

Returns:
the list of admissibility constraints.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

pretty

public java.lang.String pretty()

getNA

public int getNA()
Returns:
the number of agents.

getNO

public int getNO()
Returns:
the number of objects.

getValMaxIndividualUtility

public int getValMaxIndividualUtility()

getValMaxCollectiveUtility

public int getValMaxCollectiveUtility()