Package edu.wisc.game.tools
Class AnalyzeTranscripts
- java.lang.Object
-
- edu.wisc.game.tools.AnalyzeTranscripts
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnalyzeTranscripts.P0andR
static class
AnalyzeTranscripts.TrialListMap
Lists all trial lists for an experiment plan.
-
Field Summary
Fields Modifier and Type Field Description protected boolean
quiet
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
analyzePlayerRecord(String playerId, Vector<EpisodeHandle> v)
Reads one player's transcript, and prepares a complete report for that player.protected AnalyzeTranscripts.P0andR
computeP0andR(Vector<TranscriptManager.ReadTranscriptData.Entry[]> subsections, ParaSet para, String ruleSetName, Vector<Board> boardHistory)
Reconstructs and replays the historical episode, computing p0 for every pick or move attempt.static void
main(String[] argv)
The main() method processes the command line arguments, allowing a large variety of ways to specify the set of players whose data are to be analyzed.static void
removeDuplicates(Vector<TranscriptManager.ReadTranscriptData.Entry[]> subsections)
Removes any duplicate entries from each subsection.protected void
saveAnyData(Vector<TranscriptManager.ReadTranscriptData.Entry[]> section, Vector<EpisodeHandle> includedEpisodes)
Saves the data for a single (player, ruleSet) pair.static Vector<TranscriptManager.ReadTranscriptData.Entry[]>
splitTranscriptIntoEpisodes(Vector<TranscriptManager.ReadTranscriptData.Entry> section)
Splits a section of transcript pertaining to a single rule set (i.e.
-
-
-
Method Detail
-
main
public static void main(String[] argv) throws Exception
The main() method processes the command line arguments, allowing a large variety of ways to specify the set of players whose data are to be analyzed.- Throws:
Exception
-
saveAnyData
protected void saveAnyData(Vector<TranscriptManager.ReadTranscriptData.Entry[]> section, Vector<EpisodeHandle> includedEpisodes) throws IOException, IllegalInputException, RuleParseException
Saves the data for a single (player, ruleSet) pair. This method can only be called if base!=null.- Parameters:
section
- A vector of arrays, each array representing the recorded moves for one episode.includedEpisodes
- All non-empty episodes played by this player in this rule set- Throws:
IOException
IllegalInputException
RuleParseException
-
splitTranscriptIntoEpisodes
public static Vector<TranscriptManager.ReadTranscriptData.Entry[]> splitTranscriptIntoEpisodes(Vector<TranscriptManager.ReadTranscriptData.Entry> section)
Splits a section of transcript pertaining to a single rule set (i.e. a series of episodes) into subsections, each subsection pertaining to one specific episode.
-
removeDuplicates
public static void removeDuplicates(Vector<TranscriptManager.ReadTranscriptData.Entry[]> subsections)
Removes any duplicate entries from each subsection. Such entries may have been created due to imperfections in the transcript-saving process.
-
computeP0andR
protected AnalyzeTranscripts.P0andR computeP0andR(Vector<TranscriptManager.ReadTranscriptData.Entry[]> subsections, ParaSet para, String ruleSetName, Vector<Board> boardHistory) throws IOException, IllegalInputException, RuleParseException
Reconstructs and replays the historical episode, computing p0 for every pick or move attempt.- Parameters:
subsections
- A (preprocessed) transcript by a player, which covers an entire series of episodes.para
- The parameter set that was in effect for this series.boardHistory
- An output parameter. If not null, we will save the board before each move to that vector. The number of entries put into this vector will be equal to the number of values put into the return value (p0)- Returns:
- An array containing p0 values for each move.
- Throws:
IOException
IllegalInputException
RuleParseException
-
analyzePlayerRecord
protected void analyzePlayerRecord(String playerId, Vector<EpisodeHandle> v) throws IOException, IllegalInputException, RuleParseException
Reads one player's transcript, and prepares a complete report for that player.- Parameters:
playerId
- The player whose record we want to analyzev
- The list of episodes played by this player- Throws:
IOException
IllegalInputException
RuleParseException
-
-