org.hd.d.pg2k.ai.scorer.fixed
Class FixedScore

java.lang.Object
  extended by org.hd.d.pg2k.ai.scorer.AbstractScorer
      extended by org.hd.d.pg2k.ai.scorer.fixed.FixedScore
All Implemented Interfaces:
BadScorer, ScorerIF

public final class FixedScore
extends AbstractScorer
implements BadScorer

Fixed score given by its single parameter. This "fake" Scorer should represent the highest "goodness" that a fake/dumb implementation (that does not look at its input) can reach; a real Scorer must do better than this to be credible.

Author:
dhd

Field Summary
private  ScorerParamInteger resultScoreParam
          Fixed result score for this variant; never null.
private static ScorerParamInteger resultScoreParamBounds
          Min, default and max result score; never null.
 
Fields inherited from class org.hd.d.pg2k.ai.scorer.AbstractScorer
nameAndParameters, parameterNameRegex, parameterSepRegex, scorerNameRegex, SEPARATOR
 
Constructor Summary
FixedScore()
          Create simple non-parameterised instance.
FixedScore(java.lang.String nameAndParameters)
          Create parameterised version.
FixedScore(java.lang.String baseName, java.util.List<ScorerParam> parameters)
          Create parameterised version.
 
Method Summary
 ScoreAndConf computeScoreAndConfidence(SimpleExhibitPipelineIF dataSource, Name.ExhibitFull exhibitName)
          Respond with the fixed score based on the parameter; never null.
 ScorerIF createVariant(java.lang.String nameAndParameters)
          Simple non-static factory for the parameterised case.
 ScorerIF createVariant(java.lang.String baseName, java.util.List<ScorerParam> parameters)
          Simple non-static factory for the parameterised case.
 java.util.List<ScorerParam> getParameterDefsAndValues()
          Get parameter definitions and values (immutable) for this Scorer; never null.
 
Methods inherited from class org.hd.d.pg2k.ai.scorer.AbstractScorer
canonicalise, createPerturbedVariant, getBaseName, getDefaultName, getNameAndParameters, getPerturbedDefsAndValues, isValidParameterName, isValidScorerName, paramListAsMap, paramListAsString, parseNameAndParameters, similarNParams, verySimilar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resultScoreParamBounds

private static final ScorerParamInteger resultScoreParamBounds
Min, default and max result score; never null.


resultScoreParam

private final ScorerParamInteger resultScoreParam
Fixed result score for this variant; never null.

Constructor Detail

FixedScore

public FixedScore()
Create simple non-parameterised instance.


FixedScore

public FixedScore(java.lang.String nameAndParameters)
Create parameterised version.


FixedScore

public FixedScore(java.lang.String baseName,
                  java.util.List<ScorerParam> parameters)
Create parameterised version.

Method Detail

createVariant

public ScorerIF createVariant(java.lang.String nameAndParameters)
                       throws java.lang.IllegalArgumentException
Simple non-static factory for the parameterised case.

Specified by:
createVariant in interface ScorerIF
Throws:
java.lang.IllegalArgumentException - for unparsable or inappropriate input

createVariant

public ScorerIF createVariant(java.lang.String baseName,
                              java.util.List<ScorerParam> parameters)
                       throws java.lang.IllegalArgumentException
Simple non-static factory for the parameterised case.

Specified by:
createVariant in interface ScorerIF
Throws:
java.lang.IllegalArgumentException - for unparsable or inappropriate input

computeScoreAndConfidence

public ScoreAndConf computeScoreAndConfidence(SimpleExhibitPipelineIF dataSource,
                                              Name.ExhibitFull exhibitName)
                                       throws java.io.IOException
Respond with the fixed score based on the parameter; never null.

Specified by:
computeScoreAndConfidence in interface ScorerIF
Parameters:
dataSource - source of exhibit data and metadata; never null
exhibitName - full name of exhibit; must be syntactically valid and not null
Throws:
java.io.IOException - in case of difficulty fetching the exhibit details/data or in computing the result

getParameterDefsAndValues

public java.util.List<ScorerParam> getParameterDefsAndValues()
Get parameter definitions and values (immutable) for this Scorer; never null.

Specified by:
getParameterDefsAndValues in interface ScorerIF
Overrides:
getParameterDefsAndValues in class AbstractScorer

DHD Multimedia Gallery V1.53.0

Copyright (c) 1996-2009, Damon Hart-Davis. All rights reserved.