Class PerformanceMeasuresNode

java.lang.Object
edu.tufts.hrilab.action.db.performanceMeasures.PerformanceMeasuresNode

public class PerformanceMeasuresNode extends Object
Tree to keep track of the probability an action will succeed and the expect time given arguments Using tree instead of table for easier lookup of queries using unbound args
  • Constructor Details

    • PerformanceMeasuresNode

      public PerformanceMeasuresNode(Symbol value)
  • Method Details

    • setEffectInformation

      public void setEffectInformation(List<Predicate> effects)
    • savePerformanceMeasures

      public boolean savePerformanceMeasures(com.google.gson.stream.JsonWriter writer, com.google.gson.Gson gson)
      recursively save performance measures using the json writer
      Parameters:
      writer - json writer
      gson - used to convert config classes to json
    • updatePerformanceModels

      public void updatePerformanceModels(List<Symbol> argValues, boolean isSuccess, double time)
      incremental update of experience and time distribution
      Parameters:
      argValues - input values to action parameters, used to find correct performance node
      isSuccess - did the effect hold / did the action succeed
      time - time to complete the action
    • updateEffectPerformanceModels

      public void updateEffectPerformanceModels(Map<Predicate,Boolean> effectHolds, List<Symbol> argValues)
      incremental update of effect models
      Parameters:
      effectHolds - map from effect predicate to boolean value
      argValues - input vaules to aciton parameters, used to update correct performance node
    • updatePerformanceModels

      public void updatePerformanceModels(List<Symbol> argValues, double experience, double holds, double successTimeMean, double successTimeVar, double successSumSqDiff, double failureTimeMean, double failureTimeVar, double failureSumSqDiff, ConfigEffectMeasures effMeasures, Map<String,List<Predicate>> dependentGroups)
      batch update of time distribution (reading performance measures from file)
      Parameters:
      argValues - input values to action parameters, used to find correct performance node
      experience - total number of times action has been executed
      holds - number of times the effect hold / did the action succeed
      successTimeMean - mean time to complete the action with specified args
      successTimeVar - variance time to complete the action with specified args
    • getPerformanceMeasures

      public PerformanceMeasuresNode getPerformanceMeasures(List<Symbol> argValues)
    • sampleEffects

      public Map<Predicate,Boolean> sampleEffects(Map<Predicate,Boolean> given)
    • getExperience

      public org.apache.commons.lang3.tuple.Pair<Integer,Integer> getExperience()
    • getTimeDistribution

      public org.apache.commons.lang3.tuple.Pair<Double,Double> getTimeDistribution(boolean holds)
    • getTimeProbability

      public org.apache.commons.lang3.tuple.Pair<Double,Double> getTimeProbability(List<Symbol> argValues, boolean holds)
      Parameters:
      argValues -
      Returns:
      mean, variance
    • getExperience

      public org.apache.commons.lang3.tuple.Pair<Integer,Integer> getExperience(List<Symbol> argValues)