coser.datamodel.decisionsystem
类 TimeConstraintNominalDecisionSystem

java.lang.Object
  继承者 Instances
      继承者 coser.datamodel.decisionsystem.RoughDecisionSystem
          继承者 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem
              继承者 coser.datamodel.decisionsystem.NominalDecisionSystem
                  继承者 coser.datamodel.decisionsystem.TimeNominalDecisionSystem
                      继承者 coser.datamodel.decisionsystem.TimeConstraintNominalDecisionSystem

public class TimeConstraintNominalDecisionSystem
extends TimeNominalDecisionSystem

Summary: Time constraint nominal decision system.

Copyright: The source code and all documents are open and free. PLEASE keep this header while revising the program.

Organization: Lab of Granular Computing, Zhangzhou Normal University, Fujian 363000, China.
Project: The cost-sensitive rough sets project.

Author: Zhongyi Sun
Progress: the very beginning.
Written time: January 12, 2013.
Last modify time: January 12, 2013.


字段摘要
修饰符 和 类型 字段 和 描述
(专用软件包)  long[] exhaustiveSubreductResultArray
          An array to store running information of exhaustive algorithm for sub-reduct.
static int MAX_TESTS_FOR_EXHAUSTIVE
          Maximal number of tests for exhaustive algorithms.
(专用软件包)  int optimalSubreductConsistency
           
(专用软件包)  int optimalSubreductCost
           
(专用软件包)  long[] optimalSubreductsArray
           
 
从类 coser.datamodel.decisionsystem.TimeNominalDecisionSystem 继承的字段
lambda, weighting
 
从类 coser.datamodel.decisionsystem.NominalDecisionSystem 继承的字段
ATTRIBUTES_COMBINATIONS, BACKTRACK, EXPONENTIAL, reductMinimalSize
 
从类 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem 继承的字段
alpha, COMPLEX_COMMON_TEST_COST, COST_TYPE_MONEY, COST_TYPE_TESTING_TIME, COST_TYPE_WAITING_TIME, currentReductCost, currentReductTime, currentReductTotalTestCost, DEFAULT_AVERAGE_NUMBER_OF_TESTS_PER_GROUP, groupCommonTestCostArray, groupInclusionArray, groupInclusionMatrix, IMPOSSIBLE_COST, individualCostDistributions, individualCostLowerBounds, individualCostMatrix, individualCostRandom, individualCostUpperBounds, minimalTestCostReduct, minimalTimeReduct, misclassificationCostMatrix, misclassificationCostSumArray, NORMAL, optimalReductTestCost, optimalReductTime, PARETO, randomMode, SIMPLE_COMMON_TEST_COST, TEST_COST_INDEPENDENT, TEST_COST_TYPES, testCostConstraint, testCostRelationship, testingOrderMatrix, timeParts, totalTimeConstraint, unifiedMisclassificationCost, UNIFORM
 
从类 coser.datamodel.decisionsystem.RoughDecisionSystem 继承的字段
allConditions, allReducts, allReductsFilename, allSubreducts, allSubreductsFilename, arffFilename, backtrackSteps, candidateReductArray, candidateSubreductArray, candidateSubreductConsistencyArray, classSize, CONDITIONAL_ENTROPY, consistency, core, currentReduct, currentSelectedAttributes, endTime, MAJORITY, minimalReductSize, numberOfCandidateReducts, numberOfCandidateSubreducts, numberOfConditions, numberOfInstances, optimalReduct, POSITIVE_REGION, runTimeInformation, startTime, totalEntropy, totalMajority, totalPositiveRegion
 
构造方法摘要
构造函数 和 描述
TimeConstraintNominalDecisionSystem(Instances dataset)
          Construct the decision system.
TimeConstraintNominalDecisionSystem(Instances dataset, int capacity)
          Construct the decision system.
TimeConstraintNominalDecisionSystem(Instances source, int first, int toCopy)
          Construct the decision system.
TimeConstraintNominalDecisionSystem(java.io.Reader reader)
          Construct the decision system.
TimeConstraintNominalDecisionSystem(java.lang.String name, FastVector attInfo, int capacity)
          Construct the decision system.
TimeConstraintNominalDecisionSystem(TimeConstraintNominalDecisionSystem paraDataset, boolean[] paraSelectedAttributes)
          Construct the decision system.
 
方法摘要
修饰符 和 类型 方法 和 描述
protected  long[] computeConstraintSatisfiedTimeSetsBacktrack(int paraConstraint)
          /** Compute all test sets satisfying the time cost constraint using the backtrack approach.
protected  long[] computeConstraintSatisfiedTimeSetsBacktrack(int paraConstraint, boolean[] paraAvailableAttributes)
          Compute all test sets satisfying the time cost constraint using the backtrack approach.
 int computeOptimalTimeCost()
          Find an optimal sub-reduct using the SESRA algorithm.
 java.lang.String constraintReductionSESRA(int paraConstraint)
          Find an optimal sub-reduct using the SESRA algorithm.
 java.lang.String constraintReductionSESRA(int paraConstraint, boolean[] paraAvailableAttributes)
          Find an optimal sub-reduct using the SESRA algorithm.
 boolean constraintSatisfied(boolean[] paraSelectedTests, int paraConstraint)
          Judge whether or not the given test set satisfy the constraint.
 long[] getExhaustiveSubreductResults()
          Get sub-reduct results (exhaustive algorithms).
 int getOptimalSubreductConsistency()
          Get the optimal sub-reduct consistency.
static void main(java.lang.String[] args)
          Only for testing.
protected  long[] removeShortTestSets(long[] paraInitialTestSetArray)
          Remove short test sets such that we do not have to compute their consistency.
protected  long[] removeShortTestSets(long[] paraInitialTestSetArray, int paraNumberOfTestSets)
          Remove short test sets such that we do not have to compute their consistency.
protected  long[] selectMaximalConsistencySubreducts(long[] paraSubreducts)
          Select sub-reducts with the maximal consistency.
 java.lang.String toString()
          For toString().
 
从类 coser.datamodel.decisionsystem.TimeNominalDecisionSystem 继承的方法
computeFeatureSubsetTime, featureSubsetCompare, isCurrentReductOptimal, readPartialOrderMatrix, sortByWaitingTime
 
从类 coser.datamodel.decisionsystem.NominalDecisionSystem 继承的方法
buildCandidateReducts, computeAllReductsBacktrack, computeAllReductsBacktrack, computeAllReductsExhaustive, computeAllReductsExhaustive, computeAllReductsExhaustive, computeAllReductsExhaustiveExponential, computeAllSubreducts, computeConsistency, computeCore, computeOptimalReductBacktrack, conditionalEntropy, entropyBasedReduction, informationGain, informationGain, majority, majority, optimalReductBacktrack, positiveRegion, positiveRegion, removeRedundantSubreducts, splitData, splitData, splitData
 
从类 coser.datamodel.decisionsystem.CostSensitiveDecisionSystem 继承的方法
averageMisclassificationCost, averageMisclassificationCost, averageMisclassificationCost, averageMisclassificationCost, bestClassValue, computeAdditiveCost, computeExceedingFactor, computeOptimalTestCost, computeReductTestCost, computeReductWaitingTime, computeTestCost, computeTestCost, copyForClone, generateIndividualCosts, generateOneCost, getClassificationCost, getDistributionString, getIndividualCost, getIndividualTestCost, getIndividualTestCostArray, getMisclassificationCostMatrix, getOptimalReductTestCost, getReductTotalTestCost, initializeForReduction, refreshTestCost, setAlpha, setComplexCommonTestCostArrays, setCostRandomMode, setIndividualCostArray, setIndividualCostBounds, setIndividualCostDistribution, setMisclassificationCostMatrix, setMisclassificationCostMatrix, setSimpleCommonTestCostArrays, setTestCostsRelationShip, setUnifiedMisclassificationCost, sortByTestCost
 
从类 coser.datamodel.decisionsystem.RoughDecisionSystem 继承的方法
classEntropy, classEntropy, computeConsistency, computeConsistency, computeCore, conditionalEntropy, conditionalEntropy, copyForClone, delete, divideInTwo, entropyReciprocal, entropyReciprocal, entropyReciprocal, entropyReciprocal, entropyReciprocal, getAllReductsFilename, getAllReductsString, getAllSubreductsFilename, getArffFilename, getArffSource, getBacktrackSteps, getCandidateSubreductConsistencyArray, getCurrentReduct, getCurrentReductIndex, getMeasure, getNumberOfConditions, getOptimalReduct, getReductionTime, getReductString, getRunTimeInformation, hasMissingValue, isNominal, isNormalized, isNumeric, majority, majority, normalize, positiveRegion, positiveRegion, printAllReducts, readAllReducts, readAllReducts, readAllSubreducts, readAllSubreducts, setAllReductsFilename, setAllReductsFilename, setAllSubreductsFilename, setAllSubreductsFilename, setArffFilename, setCurrentReduct, setCurrentReduct, setMeasure, writeAllReducts
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

MAX_TESTS_FOR_EXHAUSTIVE

public static final int MAX_TESTS_FOR_EXHAUSTIVE
Maximal number of tests for exhaustive algorithms.

另请参见:
常量字段值

optimalSubreductConsistency

int optimalSubreductConsistency

optimalSubreductCost

int optimalSubreductCost

exhaustiveSubreductResultArray

long[] exhaustiveSubreductResultArray
An array to store running information of exhaustive algorithm for sub-reduct. The length is 10. The content is stored as follows:
[0]: the number of test sets satisfying the constraint.
[1]: the number of test sets with consistency checked.
[2]: the number of maximal consistency test sets.
[3]: the number of minimal cost test sets.
[4]: the time for candidates building.
[5]: the time for computing consistency.
[6]: the time for the execution.
[7]: the number of maximal consistency test sets. Applicable to SESRAstar and AROP_S to count the number after reduction.
[8]: backtrack steps.
[9]: the length of the sub-reduct.


optimalSubreductsArray

long[] optimalSubreductsArray
构造方法详细信息

TimeConstraintNominalDecisionSystem

public TimeConstraintNominalDecisionSystem(java.io.Reader reader)
                                    throws java.io.IOException,
                                           java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.io.IOException
java.lang.Exception

TimeConstraintNominalDecisionSystem

public TimeConstraintNominalDecisionSystem(Instances dataset)
                                    throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

TimeConstraintNominalDecisionSystem

public TimeConstraintNominalDecisionSystem(Instances dataset,
                                           int capacity)
                                    throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

TimeConstraintNominalDecisionSystem

public TimeConstraintNominalDecisionSystem(Instances source,
                                           int first,
                                           int toCopy)
                                    throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

TimeConstraintNominalDecisionSystem

public TimeConstraintNominalDecisionSystem(java.lang.String name,
                                           FastVector attInfo,
                                           int capacity)
                                    throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception

TimeConstraintNominalDecisionSystem

public TimeConstraintNominalDecisionSystem(TimeConstraintNominalDecisionSystem paraDataset,
                                           boolean[] paraSelectedAttributes)
                                    throws java.lang.Exception
Construct the decision system. Simply adopt everything of the super class.

抛出:
java.lang.Exception
方法详细信息

computeConstraintSatisfiedTimeSetsBacktrack

protected long[] computeConstraintSatisfiedTimeSetsBacktrack(int paraConstraint)
                                                      throws java.lang.Exception
/** Compute all test sets satisfying the time cost constraint using the backtrack approach.

参数:
paraConstraint - the time cost upper bound.
返回:
all test setss satisfying the constraint.
抛出:
java.lang.Exception

computeConstraintSatisfiedTimeSetsBacktrack

protected long[] computeConstraintSatisfiedTimeSetsBacktrack(int paraConstraint,
                                                             boolean[] paraAvailableAttributes)
                                                      throws java.lang.Exception
Compute all test sets satisfying the time cost constraint using the backtrack approach.

参数:
paraConstraint - the test cost upper bound.
paraAvailableAttributes - which tests are available.
返回:
all test setss satisfying the constraint.
抛出:
java.lang.Exception

constraintReductionSESRA

public java.lang.String constraintReductionSESRA(int paraConstraint)
                                          throws java.lang.Exception
Find an optimal sub-reduct using the SESRA algorithm.

参数:
paraConstraint - the time cost upper bound.
返回:
A brief summary of results. Other results are stored in the object.
抛出:
java.lang.Exception

computeOptimalTimeCost

public int computeOptimalTimeCost()
                           throws java.lang.Exception
Find an optimal sub-reduct using the SESRA algorithm.

覆盖:
类 TimeNominalDecisionSystem 中的 computeOptimalTimeCost
返回:
the optimal time-cost.
抛出:
java.lang.Exception

constraintReductionSESRA

public java.lang.String constraintReductionSESRA(int paraConstraint,
                                                 boolean[] paraAvailableAttributes)
                                          throws java.lang.Exception
Find an optimal sub-reduct using the SESRA algorithm.

参数:
paraConstraint - the test cost upper bound.
paraAvailableAttributes - which tests are available.
返回:
A brief summary of results. Other results are stored in the object.
抛出:
java.lang.Exception

getOptimalSubreductConsistency

public int getOptimalSubreductConsistency()
                                   throws java.lang.Exception
Get the optimal sub-reduct consistency.

返回:
the optimal test-cost reducts.
抛出:
java.lang.Exception

removeShortTestSets

protected long[] removeShortTestSets(long[] paraInitialTestSetArray)
                              throws java.lang.Exception
Remove short test sets such that we do not have to compute their consistency. Simply invoke another method.

参数:
paraInitialTestSetArray - test sets are representated by integers. It must be sorted in an ascending order.
返回:
longer test sets.
抛出:
java.lang.Exception

removeShortTestSets

protected long[] removeShortTestSets(long[] paraInitialTestSetArray,
                                     int paraNumberOfTestSets)
                              throws java.lang.Exception
Remove short test sets such that we do not have to compute their consistency. This is done through removing any subsets of given test sets.

参数:
paraInitialTestSetArray - test sets are representated by integers. It must be sorted in an ascending order.
paraNumberOfTestSets - the effective number of elements in paraInitialTestSetArray.
返回:
longer test sets.
抛出:
java.lang.Exception
另请参见:
#constraintReductionSESRAstar(int)

selectMaximalConsistencySubreducts

protected long[] selectMaximalConsistencySubreducts(long[] paraSubreducts)
                                             throws java.lang.Exception
Select sub-reducts with the maximal consistency.

参数:
paraSubreducts - test sets are representated by long. It must be sorted in an ascending order.
返回:
longer test sets.
抛出:
java.lang.Exception
另请参见:
constraintReductionSESRA(int), #constraintReductionSESRAstar(int)

getExhaustiveSubreductResults

public long[] getExhaustiveSubreductResults()
Get sub-reduct results (exhaustive algorithms).

返回:
results in an int array.

constraintSatisfied

public boolean constraintSatisfied(boolean[] paraSelectedTests,
                                   int paraConstraint)
                            throws java.lang.Exception
Judge whether or not the given test set satisfy the constraint.

参数:
paraSelectedTests - Selected tests represented by a boolean array.
paraConstraint - The constraint.
抛出:
java.lang.Exception - if it is thrown by computeTestCost().

toString

public java.lang.String toString()
For toString(). See interface toString().

覆盖:
类 TimeNominalDecisionSystem 中的 toString
返回:
object status.

main

public static void main(java.lang.String[] args)
Only for testing. Read the partial order file.