org.decisiondeck.xmcda_oo.data
Class RandomGeneratorOld

java.lang.Object
  extended by org.decisiondeck.xmcda_oo.data.BasicGenerator
      extended by org.decisiondeck.xmcda_oo.data.RandomGeneratorOld

public class RandomGeneratorOld
extends BasicGenerator

A basic generator with the added capability of generating random data.

See Also:
BasicGenerator

Nested Class Summary
 
Nested classes/interfaces inherited from class org.decisiondeck.xmcda_oo.data.BasicGenerator
BasicGenerator.DefaultNamer
 
Field Summary
static int MAX_WEIGHTS_SPREAD
           
 
Fields inherited from class org.decisiondeck.xmcda_oo.data.BasicGenerator
END_OF_SCALE, START_OF_SCALE
 
Constructor Summary
RandomGeneratorOld()
           
 
Method Summary
 Map<DecisionMaker,Set<Alternative>> genAlternativesAttribution(int nbAlternativesTot, int nbDms, int nbAlternativesPerDm)
           Generates an attribution of a set of alternatives to a set of decision makers.
 IEvaluations genAlternativesEvaluations(int nbAlternatives, int nbCriteria)
          Generates random alternatives evaluations.
 Map<DecisionMaker,ICoalitions> genCoalitions(int nbCoalitions, int nbCriteria)
          Generates random coalitions.
 Map<DecisionMaker,IEvaluations> genProfilesEvaluations(int nbDms, int nbProfiles, int nbCriteria)
          Generates random profiles evaluations for the given number of decision makers.
 IEvaluations genSharedProfilesEvaluations(int nbProfiles, int nbCriteria)
          Generates random profiles evaluations, the same for all decision makers.
 Map<DecisionMaker,Set<Alternative>> getAlternativesAttribution()
           
 ISortingPreferences getPreferencesWithAttributed(DecisionMaker dm)
          The alternatives must have been attributed.
 Set<Alternative> keepOnlyAttributedAlternatives()
          The alternatives attribution must have been generated.
 
Methods inherited from class org.decisiondeck.xmcda_oo.data.BasicGenerator
areIdsInts, genAlternatives, genCategories, genCriteria, genDms, genProfiles, genScales, genSplitProfilesEvaluations, getAlternativeNamer, getData, roundsUp, setAlternativeNamer, setAlternatives, setCategories, setCriteria, setDms, setRoundUp, setScales
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_WEIGHTS_SPREAD

public static final int MAX_WEIGHTS_SPREAD
See Also:
Constant Field Values
Constructor Detail

RandomGeneratorOld

public RandomGeneratorOld()
Method Detail

genCoalitions

public Map<DecisionMaker,ICoalitions> genCoalitions(int nbCoalitions,
                                                    int nbCriteria)
Generates random coalitions. Uses (or generates if not set) decision makers, criteria.

Parameters:
nbCoalitions - to generate (will generate or expect the same number of decision makers).
nbCriteria - to use or to generate.
Returns:
not null.

genAlternativesEvaluations

public IEvaluations genAlternativesEvaluations(int nbAlternatives,
                                               int nbCriteria)
Generates random alternatives evaluations. Uses alternatives, criteria, scales.

Parameters:
nbAlternatives - the number of alternatives to generate (or use) and to set evaluations for.
nbCriteria - the number of criteria to generate (or use) and to set evaluations for, will also generate (or use) the scales.
Returns:
not null, a copy.

genAlternativesAttribution

public Map<DecisionMaker,Set<Alternative>> genAlternativesAttribution(int nbAlternativesTot,
                                                                      int nbDms,
                                                                      int nbAlternativesPerDm)

Generates an attribution of a set of alternatives to a set of decision makers. Each decision maker is given a given number of alternatives chosen randomly among the set of alternatives. The attributed alternatives sets are not necessarily disjoint, i.e. the random picking is done with replacement.

If the total number of alternatives equals the number of alternatives per decision maker, each decision maker is attributed the full set of alternatives.

Parameters:
nbAlternativesTot - total number of alternatives to choose from, to generate or to use. May be larger than the number of alternatives to be attributed.
nbDms - number of decision makers, to generate or to use.
nbAlternativesPerDm - number of alternatives to attribute to each decision maker.
Returns:
for each decision maker, a set of alternatives, subset of the full set of alternatives. The sets and the map are mutable and are copies.

keepOnlyAttributedAlternatives

public Set<Alternative> keepOnlyAttributedAlternatives()
The alternatives attribution must have been generated. Removes from this object every alternative that has not been attributed.

Returns:
the newly (possibly) reduced set of alternatives (a mutable copy).

getAlternativesAttribution

public Map<DecisionMaker,Set<Alternative>> getAlternativesAttribution()
Returns:
null iff the attributions have not been generated. Otherwise, a mutable copy.

getPreferencesWithAttributed

public ISortingPreferences getPreferencesWithAttributed(DecisionMaker dm)
The alternatives must have been attributed.

Parameters:
dm - not null, must be in this object.
Returns:
the preferences model for the given decision maker together with all generated problem data, restricted to the alternatives attributed to the given decision maker. A mutable copy.

genProfilesEvaluations

public Map<DecisionMaker,IEvaluations> genProfilesEvaluations(int nbDms,
                                                              int nbProfiles,
                                                              int nbCriteria)
Generates random profiles evaluations for the given number of decision makers. Uses dms, profiles, criteria, scales.

Parameters:
nbDms - the number of decision makers for which to generate profiles evaluations.
nbProfiles - the number of profiles to generate (or use) and to set evaluations for.
nbCriteria - the number of criteria to generate (or use) and to set evaluations for, will also generate (or use) the scales.
Returns:
not null, a copy.

genSharedProfilesEvaluations

public IEvaluations genSharedProfilesEvaluations(int nbProfiles,
                                                 int nbCriteria)
Generates random profiles evaluations, the same for all decision makers. Uses profiles, criteria, scales. Note that generating new decision makers invalidates the shared profiles: it is probably a good idea to set the decision makers before setting the shared profiles, or to not set the decision makers at all. TODO think about setting (and checking for) keep shared profiles.

Parameters:
nbProfiles - the number of profiles to generate (or use) and to set evaluations for.
nbCriteria - the number of criteria to generate (or use) and to set evaluations for, will also generate (or use) the scales.
Returns:
not null, a copy.


Copyright © 2011. All Rights Reserved.