p3j.experiment.results
Class ParameterAssumptionEncoder

java.lang.Object
  extended by p3j.experiment.results.ParameterAssumptionEncoder

public class ParameterAssumptionEncoder
extends Object

Auxiliary class to encode assumption mappings and describe the encoding in human- and machine-readable form. Both orderedParameterInstances and encoding are necessary: the first item gives the order in which the assumptions allocated to the parameter instances are given, the second defines which index belongs to which assumption. For example, the encoded assumption sequence [0 2 3] can be used to read out a specific allocation as follows: 1. The parameter instance in question is the last item in orderedParameterInstances, so the selected assumption here is '3' 2. For this parameter instance, the index '3' refers to a specific parameter assignment. This mapping is summarised in both human- and machine-readable form. The order of the instances is defined by ParameterInstanceComparator. The order of assignments is defined by their IDs.

Author:
Christina Bohk, Roland Ewald
See Also:
ParameterAssignment, ParameterInstance, ParameterInstanceComparator

Constructor Summary
ParameterAssumptionEncoder(ProjectionModel projectionModel)
          Instantiates a new parameter assumption encoder.
 
Method Summary
 int[] encode(Map<ParameterInstance,ParameterAssignment> assignment)
          Encode a given instance -> assignment mapping to array.
 String verboseEncoding(Map<ParameterInstance,ParameterAssignment> assignment)
          Returns a verbose encoding of a given assignment.
 void writeMappingSummary(File dataDirectory)
          Writes a mapping summary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterAssumptionEncoder

public ParameterAssumptionEncoder(ProjectionModel projectionModel)
Instantiates a new parameter assumption encoder.

Parameters:
projectionModel - the projection model
Method Detail

writeMappingSummary

public void writeMappingSummary(File dataDirectory)
                         throws IOException
Writes a mapping summary. Basically the contents of encoding, ordered by orderedParameterInstances.

Parameters:
dataDirectory - the data directory
Throws:
IOException - Signals that an I/O exception has occurred.

encode

public int[] encode(Map<ParameterInstance,ParameterAssignment> assignment)
Encode a given instance -> assignment mapping to array.

Parameters:
assignment - the assignment mapping
Returns:
the encoded mapping

verboseEncoding

public String verboseEncoding(Map<ParameterInstance,ParameterAssignment> assignment)
Returns a verbose encoding of a given assignment.

Parameters:
assignment - the assignment
Returns:
the verbose encoding


Copyright © 2012. All Rights Reserved.