Wrapper
public class JRank extends java.lang.Object implements Wrapper
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
defaultPropertiesFilePath |
Disk path to a file storing default properties.
|
static java.lang.String |
pctSuffix |
Suffix added to the name of the file with learning information table.
|
boolean |
printInfoConcerningParametersInfluencingOnlyOutputFiles |
Tells if info notes concerning the values of parameters that influence only jRank output (i.e., used in
method ) should be printed in assumeAndPrintMissingJRankParameterValues() method. |
static java.lang.String |
templatePropertiesFilePath |
Disk path to a file storing template properties.
|
Constructor | Description |
---|---|
JRank() |
Sole constructor;
|
Modifier and Type | Method | Description |
---|---|---|
void |
assumeAndPrintMissingJRankParameterValues() |
Checks if all jRank parameters are set.
|
PairOfIndices[] |
calculateLearningPairsThatCannotBePreservedInOriginalRelation(RankerParameters rankerParameters) |
Calculates learning pairs of objects that cannot be preserved in original relation
|
void |
calculatePairsThatCannotBePreserved() |
Calculates pairs that cannot be preserved in preference/non-outranking relation.
|
PairOfIndices[] |
calculateTestPairsThatCannotBePreservedInPreferenceRelation(MemoryContainer testInformationTable) |
Calculates test pairs of objects that cannot be preserved in preference relation
|
java.util.ArrayList<NamedProperties> |
createNamedPropertiesList(java.lang.String[] args) |
Creates named properties list for given array of *.properties file paths
|
JRankParameters |
getJRankParameters() |
Gets jRank parameters
|
JRankResults |
getJRankResults() |
Gets jRank results
|
int |
getLatestAllowedStartingStep() |
Gets latest allowed starting step
|
void |
initializeJRankParameters() |
Initializes jRank parameters.
|
static void |
main(java.lang.String[] args) |
Main method allowing running this class
|
boolean |
readJRankParameters(java.util.ArrayList<NamedProperties> namedPropertiesList) |
Reads all jRank parameters at once.
|
boolean |
readJRankPrivateParameters(java.util.ArrayList<NamedProperties> namedPropertiesList) |
Reads jRank private parameters.
|
boolean |
readLearningAndTestData(java.lang.String learningDataFile,
java.lang.String testDataFile) |
Reads learning and test data into ranker parameters.
|
boolean |
readPreferenceInformation(java.util.ArrayList<NamedProperties> namedPropertiesList) |
Reads preference information (reference ranking or pairwise comparisons) into ranker parameters.
|
void |
readSimpleRankerParameters(java.util.ArrayList<NamedProperties> namedPropertiesList) |
Reads simple ranker parameters (which are just variables, not objects).
|
JRankResults |
run() |
Method conducting all calculations and storing their results.
|
JRankResults |
run(int startingStep) |
Method conducting all calculations starting at a given step and storing their results.
|
JRankResults |
run(int startingStep,
int lastStep) |
Method conducting all calculations starting at a given step and storing their results.
|
void |
saveJRankResults() |
Method saving calculation results to disk files.
|
boolean |
selectivelyUpdateJRankParameters(java.util.ArrayList<NamedProperties> namedPropertiesList,
MemoryContainer learningInformationTable,
MemoryContainer testInformationTable) |
SIC!
|
boolean |
setConsideredSetOfRules(java.lang.String consideredSetOfRules) |
Sets considered set of rules.
|
boolean |
setConsistencyMeasureThreshold(java.lang.String consistencyMeasureThreshold) |
Sets consistency measure threshold
|
boolean |
setFuzzySatisfactionDegreeCalculationMethod(java.lang.String fuzzySatisfactionDegreeCalculationMethod) |
Sets fuzzy satisfaction degree calculation method.
|
void |
setJRankParameters(JRankParameters jRankParameters) |
SIC!
|
void |
setLearningData(MemoryContainer learningInformationTable) |
Sets learning information table.
|
void |
setLearningDataFile(java.lang.String learningDataFile) |
Sets learning data file.
|
boolean |
setRankingProcedure(java.lang.String rankingProcedure) |
Sets ranking procedure.
|
boolean |
setSatisfactionDegreesInPreferenceGraph(java.lang.String satisfactionDegreesInPreferenceGraph) |
Sets satisfaction degrees in preference graph
|
void |
setTestData(MemoryContainer testInformationTable) |
Sets test information table.
|
void |
setTestDataFile(java.lang.String testDataFile) |
Sets test data file.
|
boolean |
setTypeOfFamilyOfCriteria(java.lang.String typeOfFamilyOfCriteria) |
Sets type of family of criteria.
|
boolean |
setWeightsType(java.lang.String weightsType) |
Sets type of weights used by a preference graph exploiter.
|
void |
writeDefaultPropertiesFile(java.lang.String fileName) |
Writes *.properties file with names, default values and comments for those parameters, which are rarely changed.
|
void |
writeTemplatePropertiesFile(java.lang.String fileName) |
Writes template *.properties file with names, default values and comments for those parameters which are frequently changed.
|
public static final java.lang.String templatePropertiesFilePath
public static final java.lang.String defaultPropertiesFilePath
public static java.lang.String pctSuffix
public boolean printInfoConcerningParametersInfluencingOnlyOutputFiles
method
) should be printed in assumeAndPrintMissingJRankParameterValues()
method.public static void main(java.lang.String[] args)
args
- program input arguments. There should be at least one argument. Each argument is a path to file.
Each pointed file should be standard Java properties file.public PairOfIndices[] calculateLearningPairsThatCannotBePreservedInOriginalRelation(RankerParameters rankerParameters)
rankerParameters
- ranker parametersjava.lang.NullPointerException
- when learning memory container or preference information is not setpublic PairOfIndices[] calculateTestPairsThatCannotBePreservedInPreferenceRelation(MemoryContainer testInformationTable)
testInformationTable
- test information tablejava.lang.NullPointerException
- when test memory container is not setpublic java.util.ArrayList<NamedProperties> createNamedPropertiesList(java.lang.String[] args)
args
- array of *.properties file pathspublic boolean readJRankPrivateParameters(java.util.ArrayList<NamedProperties> namedPropertiesList)
namedPropertiesList
- named properties listtrue
if all jRank private parameters have been read, false
otherwisepublic boolean readLearningAndTestData(java.lang.String learningDataFile, java.lang.String testDataFile)
learningDataFile
- learning data filetestDataFile
- test data filetrue
in case of success, false
otherwisepublic boolean readPreferenceInformation(java.util.ArrayList<NamedProperties> namedPropertiesList)
namedPropertiesList
- named properties listtrue
if preference information was successfully read, false
otherwisepublic void readSimpleRankerParameters(java.util.ArrayList<NamedProperties> namedPropertiesList)
namedPropertiesList
- named properties listpublic void calculatePairsThatCannotBePreserved()
public void assumeAndPrintMissingJRankParameterValues()
UnknownValueException
- when the value of some parameter is unknown and cannot be setjava.lang.NullPointerException
- when learning or test information tables is not setpublic void initializeJRankParameters()
public boolean readJRankParameters(java.util.ArrayList<NamedProperties> namedPropertiesList)
namedPropertiesList
- named properties listtrue
if all jRank parameters have been read, false
otherwisepublic boolean selectivelyUpdateJRankParameters(java.util.ArrayList<NamedProperties> namedPropertiesList, MemoryContainer learningInformationTable, MemoryContainer testInformationTable)
latestAllowedStartingStep
.namedPropertiesList
- named properties listlearningInformationTable
- learning information tabletestInformationTable
- test information tabletrue
if jRank parameters have been updated, false
otherwisejava.lang.NullPointerException
- when there are no jRank parameters to updatepublic JRankResults run()
readJRankParameters(ArrayList)
or setJRankParameters(JRankParameters)
method.
The results of calculations are also stored in this class - they can be later saved using saveJRankResults()
method or obtained using getJRankResults()
method.public JRankResults run(int startingStep)
run(int, int)
.
Assumes that all jRank parameters have been already set, e.g., by using readJRankParameters(ArrayList)
or setJRankParameters(JRankParameters)
method.
The results of calculations are also stored in this class - they can be later saved using saveJRankResults()
method or obtained using getJRankResults()
method.startingStep
- starting step of calculations to perform. Can be one of Ranker.PCT_STEP
, Ranker.UNION_CONTAINER_STEP
, Ranker.RULES_STEP
, Ranker.PREFERENCE_GRAPH_STEP
, Ranker.RANKING_STEP
, or Ranker.ERRORS_STEP
.null
in case of an errorInvalidValueException
- when given starting step is too advanced w.r.t. stored ranker resultspublic JRankResults run(int startingStep, int lastStep)
readJRankParameters(ArrayList)
or setJRankParameters(JRankParameters)
method.
The results of calculations are also stored in this class - they can be later saved using saveJRankResults()
method or obtained using getJRankResults()
method.startingStep
- starting step of calculations to perform. Can be one of Ranker.PCT_STEP
, Ranker.UNION_CONTAINER_STEP
, Ranker.RULES_STEP
, Ranker.PREFERENCE_GRAPH_STEP
, Ranker.RANKING_STEP
, or Ranker.ERRORS_STEP
.lastStep
- last step of calculations to perform. Can be one of Ranker.PCT_STEP
, Ranker.UNION_CONTAINER_STEP
, Ranker.RULES_STEP
, Ranker.PREFERENCE_GRAPH_STEP
, Ranker.RANKING_STEP
, or Ranker.ERRORS_STEP
.null
in case of an errorInvalidValueException
- when given value of the starting step or last step is incorrectInvalidValueException
- when given value of the starting step is greater than the given value of last stepInvalidValueException
- when given starting step is too advanced w.r.t. stored ranker resultspublic void saveJRankResults()
public void writeTemplatePropertiesFile(java.lang.String fileName) throws java.io.IOException
Wrapper.writeTemplatePropertiesFile(String)
method.writeTemplatePropertiesFile
in interface Wrapper
fileName
- name (path) of the file where *.properties file should be savedjava.io.IOException
- when file with given name (path) can't be opened for writepublic void writeDefaultPropertiesFile(java.lang.String fileName) throws java.io.IOException
pl.poznan.put.cs.idss.jrs.wrappers.Wrapper.writeDefaultPropertiesFile(String)
method.writeDefaultPropertiesFile
in interface Wrapper
fileName
- name (path) of the file where *.properties file should be savedjava.io.IOException
- when file with given name (path) can't be opened for writepublic JRankParameters getJRankParameters()
public void setJRankParameters(JRankParameters jRankParameters)
jRankParameters
- jRank parameterspublic JRankResults getJRankResults()
public void setLearningData(MemoryContainer learningInformationTable)
learningInformationTable
- learning information tablepublic void setTestData(MemoryContainer testInformationTable)
testInformationTable
- learning information tablepublic void setLearningDataFile(java.lang.String learningDataFile)
learningDataFile
- learning data filepublic void setTestDataFile(java.lang.String testDataFile)
testDataFile
- test data filepublic boolean setTypeOfFamilyOfCriteria(java.lang.String typeOfFamilyOfCriteria)
typeOfFamilyOfCriteria
- type of family of criteriatrue
if type of family of criteria has been set, false
otherwisepublic boolean setConsistencyMeasureThreshold(java.lang.String consistencyMeasureThreshold) throws java.lang.NumberFormatException
consistencyMeasureThreshold
- consistency measure thresholdtrue
if consistency measure threshold has been set, false
otherwisejava.lang.NumberFormatException
- when given string cannot be parsed into real-valued valuepublic boolean setConsideredSetOfRules(java.lang.String consideredSetOfRules)
consideredSetOfRules
- considered set of rulestrue
if considered set of rules has been set, false
otherwisepublic boolean setSatisfactionDegreesInPreferenceGraph(java.lang.String satisfactionDegreesInPreferenceGraph)
satisfactionDegreesInPreferenceGraph
- satisfaction degrees in preference graphtrue
if satisfaction degrees in preference graph has been set, false
otherwisepublic boolean setFuzzySatisfactionDegreeCalculationMethod(java.lang.String fuzzySatisfactionDegreeCalculationMethod)
fuzzySatisfactionDegreeCalculationMethod
- fuzzy satisfaction degree calculation methodtrue
if fuzzy satisfaction degree calculation method has been set, false
otherwisepublic boolean setRankingProcedure(java.lang.String rankingProcedure)
rankingProcedure
- ranking proceduretrue
if ranking procedure has been set, false
otherwisepublic boolean setWeightsType(java.lang.String weightsType)
weightsType
- type of weights used by a preference graph exploitertrue
if type of weights has been set, false
otherwisepublic int getLatestAllowedStartingStep()