edu.indiana.iucbrf.casepackage
Class CaseGenerator

java.lang.Object
  extended by edu.indiana.iucbrf.casepackage.CaseGenerator
Direct Known Subclasses:
ParallelCSCGenerator

public class CaseGenerator
extends java.lang.Object

This class handles the automatic generation of cases, according to provided distributions. It is especially useful for populating a case base with random cases.


Field Summary
protected  Domain domain
          The domain to which these cases will apply.
protected  DistributionCollection featureNoiseDistribution
          The distributions for noise to apply, depending on noiseProbability, for each feature.
protected  int generatedCount
           
protected  double noiseProbability
          The probability of noise, applied to a feature or a solution, between 0 and 1.
protected  double problemCount
          The number of problems the case base has seen when these cases will be added.
protected  ProblemGenerator problemGenerator
          The problem generator used to generate the problem portion of each case.
protected  Distribution solutionNoiseDistribution
          The distribution for noise to apply, depending on noiseProbability, for the solution.
 
Constructor Summary
CaseGenerator(ProblemGenerator problemGenerator, DistributionCollection featureNoiseDistribution, Distribution solutionNoiseDistribution, double problemCount, double noiseProbability, Domain domain)
          Construct a CaseGenerator object.
CaseGenerator(ProblemGenerator problemGenerator, Domain domain)
           
CaseGenerator(ProblemGenerator problemGenerator, double problemCount, Domain domain)
          Construct a CaseGenerator object.
 
Method Summary
 Case generateCase()
          Randomly generate a case according to the distributions and probabilities for this generator.
protected  Case generateCase(Problem p)
           
 java.util.ArrayList generateCases(int numCases)
           
 int getGeneratedCount()
           
protected  boolean shouldApplyFeatureNoise(Case c, FeatureKey featureKey)
          Determine if noise should be applied to a given feature in a case being generated.
protected  boolean shouldApplySolutionNoise(Case c)
          Determine if noise should be applied to the solution to a case being generated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

problemCount

protected double problemCount
The number of problems the case base has seen when these cases will be added.


noiseProbability

protected double noiseProbability
The probability of noise, applied to a feature or a solution, between 0 and 1.


featureNoiseDistribution

protected DistributionCollection featureNoiseDistribution
The distributions for noise to apply, depending on noiseProbability, for each feature.


solutionNoiseDistribution

protected Distribution solutionNoiseDistribution
The distribution for noise to apply, depending on noiseProbability, for the solution.


problemGenerator

protected ProblemGenerator problemGenerator
The problem generator used to generate the problem portion of each case.


domain

protected Domain domain
The domain to which these cases will apply.


generatedCount

protected int generatedCount
Constructor Detail

CaseGenerator

public CaseGenerator(ProblemGenerator problemGenerator,
                     Domain domain)

CaseGenerator

public CaseGenerator(ProblemGenerator problemGenerator,
                     double problemCount,
                     Domain domain)
Construct a CaseGenerator object. Cases will be generated using the problem generator, distributions for the application of noise to each feature, a distribution for the application of noise to the solution, and the number of problems the system has seen when these cases are added. Noise probability is assumed 0.


CaseGenerator

public CaseGenerator(ProblemGenerator problemGenerator,
                     DistributionCollection featureNoiseDistribution,
                     Distribution solutionNoiseDistribution,
                     double problemCount,
                     double noiseProbability,
                     Domain domain)
Construct a CaseGenerator object. Cases will be generated using the problem generator, distributions for the application of noise to each feature, a distribution for the application of noise to the solution, the number of problems the system has seen when these cases are added, and the probability of applying noise to a feature or the solution.

Method Detail

getGeneratedCount

public int getGeneratedCount()

generateCase

public Case generateCase()
Randomly generate a case according to the distributions and probabilities for this generator.


generateCase

protected Case generateCase(Problem p)

generateCases

public java.util.ArrayList generateCases(int numCases)

shouldApplyFeatureNoise

protected boolean shouldApplyFeatureNoise(Case c,
                                          FeatureKey featureKey)
Determine if noise should be applied to a given feature in a case being generated. This implementation returns true with probability noiseProbability, regardless of the key sent.


shouldApplySolutionNoise

protected boolean shouldApplySolutionNoise(Case c)
Determine if noise should be applied to the solution to a case being generated. This implementation returns true with probability noiseProbability.