Package edu.wisc.game.tools
Class MwByHuman
java.lang.Object
edu.wisc.game.tools.AnalyzeTranscripts
edu.wisc.game.tools.MwByHuman
public class MwByHuman extends AnalyzeTranscripts
Ranking rule sets by the ease of learning by human players. As
requested by PK, 2022-12-22.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMwByHuman.MwSeriesThe data for a series (group of episodes played by one player under the same rule set) needed to contribute a number to an M-W Comparandum.static classMwByHuman.PrecModeUsed to control how series are assigned to comparanda -
Field Summary
Fields Modifier and Type Field Description StringinfomsgThe JSP page should always print this message.Vector<MwByHuman.MwSeries>savedMwsInfo about each episode gets added here -
Constructor Summary
Constructors Constructor Description MwByHuman(MwByHuman.PrecMode _precMode, int _targetStreak, double _defaultMStar, Fmter _fm) -
Method Summary
Modifier and Type Method Description StringexceptionTrace()voidexportSavedMws(File gsum)Exports the data generated in Stage1StringgetErrmsg()booleangetError()ExceptiongetEx()StringgetReport()protected voidgiveError(Exception _ex)protected voidgiveError(String msg)Sets the error flag and the error messagestatic voidmain(String[] argv)voidprocessStage1(Vector<String> plans, Vector<String> pids, Vector<String> nicknames, Vector<Long> uids)The Stage 1 processing involves scanning the transcripts for the players associated with the relevant experiment plan, and computing the required statistics for all (player,ruleSet) pairs involved.voidprocessStage2(boolean fromFile, boolean useMDagger, File csvOutDir)Now, the MW Test, using this.savedMws computed in stage1.protected voidsaveAnyData(Vector<TranscriptManager.ReadTranscriptData.Entry[]> section, Vector<edu.wisc.game.tools.EpisodeHandle> includedEpisodes)Saves the data (the summary of a series) for a single (player, ruleSet) pair.voidsetErrmsg(String _errmsg)voidsetError(boolean _error)voidsetFm(Fmter _fm)
-
Field Details
-
Constructor Details
-
MwByHuman
- Parameters:
_targetStreak- this is how many consecutive error-free moves the player must make (e.g. 10) in order to demonstrate successful learning.
-
-
Method Details
-
main
- Throws:
Exception
-
getReport
-
getError
public boolean getError() -
setError
public void setError(boolean _error) -
getErrmsg
-
setErrmsg
-
giveError
Sets the error flag and the error message -
giveError
-
getEx
-
exceptionTrace
-
setFm
-
processStage1
public void processStage1(Vector<String> plans, Vector<String> pids, Vector<String> nicknames, Vector<Long> uids) throws ExceptionThe Stage 1 processing involves scanning the transcripts for the players associated with the relevant experiment plan, and computing the required statistics for all (player,ruleSet) pairs involved.- Throws:
Exception
-
exportSavedMws
Exports the data generated in Stage1- Parameters:
gsum- File to write- Throws:
IOException
-
processStage2
Now, the MW Test, using this.savedMws computed in stage1. Generates a report that's attached to this.results.- Parameters:
precMode- Controls how the series are assigned to "distinct experiences".fromFile- Indicates that the m* data have come from an extrernal file, and are not internally computed.
-
saveAnyData
protected void saveAnyData(Vector<TranscriptManager.ReadTranscriptData.Entry[]> section, Vector<edu.wisc.game.tools.EpisodeHandle> includedEpisodes) throws IOException, IllegalInputException, RuleParseExceptionSaves the data (the summary of a series) for a single (player, ruleSet) pair. In some cases, a series can be skipped (not saved). This is the case if only the data for a specific target is requested (target!=null), or if we only want the data for "Naive" players.- Overrides:
saveAnyDatain classAnalyzeTranscripts- 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. This array must be aligned with section[]- Throws:
IOExceptionIllegalInputExceptionRuleParseException
-