edu.indiana.iucbrf.problem
Class ProblemGenerator

java.lang.Object
  extended by edu.indiana.iucbrf.problem.ProblemGenerator
Direct Known Subclasses:
ParallelPSPGenerator

public class ProblemGenerator
extends java.lang.Object

This class handles the construction of a problem, randomly according to given feature distributions. Each distribution generates a double, which is then used to construct a Feature in constructAbstractFeature(). This class can only generate problems containing exclusively DoubleRepresentable features.


Field Summary
protected  java.util.HashMap argMap
           
protected  Domain domain
           
protected  DistributionCollection knownFeatureDistribution
           
 
Constructor Summary
ProblemGenerator(java.util.HashMap argMap)
          Construct a problem generator with the given feature generators.
ProblemGenerator(java.util.HashMap argMap, Domain domain)
          Creates new ProblemGenerator.
 
Method Summary
 Problem generateProblem()
          Generate a problem according to the arguments and each feature's standard constructor.
 java.util.HashMap getArgMap()
          Get the map of arguments associated with this ProblemGenerator.
 void setArgumentsForFeature(FeatureKey featureKey, java.lang.Object args)
          Change (or set for the first time) the distribution for the feature at the specified index.
 void setDomain(Domain domain)
          Set the domain in which this ProblemGenerator generates problems.
 void setKnownFeatureDistribution(DistributionCollection knownFeatureDistribution)
          1.0 means feature is known.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

argMap

protected java.util.HashMap argMap

domain

protected Domain domain

knownFeatureDistribution

protected DistributionCollection knownFeatureDistribution
Constructor Detail

ProblemGenerator

public ProblemGenerator(java.util.HashMap argMap,
                        Domain domain)
Creates new ProblemGenerator.


ProblemGenerator

public ProblemGenerator(java.util.HashMap argMap)
Construct a problem generator with the given feature generators. The domain must be set via setDomain() before the ProblemGenerator can be used.

Method Detail

setDomain

public void setDomain(Domain domain)
Set the domain in which this ProblemGenerator generates problems.


setArgumentsForFeature

public void setArgumentsForFeature(FeatureKey featureKey,
                                   java.lang.Object args)
Change (or set for the first time) the distribution for the feature at the specified index. Note that args may be an array of arguments (Object[]) or a single argument (Object).


setKnownFeatureDistribution

public void setKnownFeatureDistribution(DistributionCollection knownFeatureDistribution)
1.0 means feature is known. Else feature is not known. BinomialDistribution recommended.


getArgMap

public java.util.HashMap getArgMap()
Get the map of arguments associated with this ProblemGenerator.


generateProblem

public Problem generateProblem()
                        throws DomainNotSpecifiedException
Generate a problem according to the arguments and each feature's standard constructor.

Throws:
DomainNotSpecifiedException