logging
Class AgentLogProcessor

java.lang.Object
  extended by logging.AgentLogProcessor

public class AgentLogProcessor
extends java.lang.Object

This class holds all the methods that are used to process AgentLogging objects and create output graphs and files showing the scenario progress. A simple analysis is conducted by the methods here to evaluate the believability and emergence of the scenario. For graph plotting we used free Java library JFreeChart.


Field Summary
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> agentActionCounts
           
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> agentDoubleActions
           
(package private)  java.util.HashMap<java.lang.Integer,java.lang.String> agentNamesMap
          We will use this for proposals plotting, filled with makeAgenProposal method required for complex emotions plot
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>>> agentSubscenesActionCounts
           
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>>> agentSubscenesDoubleActions
          Here we store two succesive actions (double actions) of one character to another character.
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,AgentLogging>> agLogCache
          Here we store all three agLog files containing the complete info for one experiment.
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<FeelingLog>>>> agLogFeelings
          Here we store feeling information from all of the experiments.
(package private) static boolean bAllowFrames
           
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location boyHomeLocation
          Boy home location
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location cinemaLocation
          Cinema location
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> eventsFeelingDifferences
           
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location firstGirlHomeLocation
          First girl home location - for Anne.
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location meetingCinemaLocation
          This should point in front of the cinema
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>> missedActionsCount
          Here we store global statistcis for each agent about number of actions he missed - did not perceived.
 java.lang.Object obj
           
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location parkLocation
          Park location
 cz.cuni.amis.pogamut.base3d.worldview.objects.Location secondGirlHomeLocation
          First girl home location - for Clementine.
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> subsceneFeelingDifferences
          Used in analyzeScenario method.
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> subsceneFeelingEndValue
          Filled in analyse scenario.
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> subsceneFeelingRanges
          Used in analyzeScenario method.
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> subsceneFeelingsFileLog
          same as above, except the first key is actual fileLog name
(package private)  java.util.HashMap<java.lang.String,java.lang.Integer> subsceneIdIntMap
          This is for mapping subscene Ids to int so we can manipulate with it better
 int subsceneIntId
           
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Double>> subscenesDurations
          Here we store the durations of subscens for each log file (first hash map key).
(package private)  java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Integer>> subsceneStrings
          Here we store all subscene strings for all agLog files. identifier is the name of agLog file, the value is subscene string
(package private)  java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> suspiciousDoubleActions
          Idexed by pre-defined suspicious double actions ID, the list contains the filenames of agentLog files that contains these suspicous doubleactions...
(package private)  java.util.HashMap<java.lang.String,java.lang.Boolean> suspiciousDoubleSubscenes
          Indexed by suspicious double subscenes.
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Double>> suspiciousFeelingDifference
          This is indexed by agentLog filename, then there is a list of either subscens id with suspicious value and/or event id with suspicious value.
 
Constructor Summary
AgentLogProcessor()
           
 
Method Summary
 void analyzeFeeling(AgentLogging agLog, java.lang.String directory)
          Makes feeling txt log file for input AgentLogging object.
private  void analyzeMissedActions(java.util.HashMap<java.lang.String,AgentLogging> inputAgLogs, java.lang.String agLogIndex, java.lang.String directory)
          Here we will log missed actions for the experiment in a log file and we will store the numbers into global statistics file.
 void analyzeScenario(AgentLogging agLog, java.lang.String directory)
          Analyze scenario regarding feelings, double actions strings, subscenes string and feeling development.
private  java.util.Collection<FeelingSceneResult> analyzeSubsceneFeelings(AgentLogging agLog, double lowerBound, double upperBound)
          Analyze one subscene feelings - how they were developing.
private  org.jfree.chart.plot.CategoryPlot createBoxAndWhiskerCategoryPlot(java.lang.String xAxisName, java.lang.String yAxisName, org.jfree.data.statistics.BoxAndWhiskerCategoryDataset dataset)
          Creates box plot graph.
private static org.jfree.chart.JFreeChart createCategoryChart(java.lang.String chartTitle, java.lang.String xAxisName, java.lang.String yAxisName, org.jfree.data.category.CategoryDataset dataset, double lowerRange, double upperRange)
          Creates category chart.
private  org.jfree.chart.plot.CategoryPlot createCategoryPlot(java.lang.String plotName, java.lang.String rangeAxisName, java.lang.String domainAxisName, double lowerRange, double upperRange, org.jfree.data.category.CategoryDataset dataset, double leftOffset)
          Creates one Category plot - used when creating multigraphs.
private  org.jfree.chart.JFreeChart createCombinedCategoryChart(java.lang.String chartTitle, java.lang.String firstXAxisName, org.jfree.data.category.CategoryDataset firstDataset, double lowerRange, double upperRange, java.lang.String secondXAxisName, org.jfree.data.category.CategoryDataset secondDataset, java.lang.String domainAxisName, double leftOffset)
          Creates combined category chart - two graphs in one.
private static org.jfree.chart.JFreeChart createLineChart(java.lang.String chartTitle, java.lang.String xAxisName, java.lang.String yAxisName, org.jfree.data.xy.XYDataset dataset, boolean bAutoRange, double lowerRange, double upperRange)
          Creates line chart.
private  org.jfree.chart.plot.XYPlot createXYPlot(java.lang.String plotName, java.lang.String rangeAxisName, java.lang.String domainAxisName, double lowerRange, double upperRange, org.jfree.data.xy.XYDataset dataset)
          Creates one XYPlot.
private  java.util.List generateOneByOneList(org.jfree.data.Range range)
          Generate list of values for scatter plot.
private  java.lang.String getPosition(LocationLog locLog)
          Returns the scenario place our agent is at.
private  java.lang.String getSceneId(java.lang.Integer i)
          Gets the sceneName from integer, uses subsceneIdIntMap.
private  java.lang.String getSubscene(AgentStateLog stateLog)
          Returns name of the subscene the agentState corresponds to.
private  java.util.HashMap<java.lang.String,java.util.ArrayList<ActionLog>> getSubsceneActions(org.jfree.data.Range range, AgentLogging agLog)
          Gets list of actions during one supported agent subscene.
private  java.util.HashMap<java.lang.String,org.jfree.data.Range> getSubscenes(AgentLogging agLog, double minimalLength)
          Returns hashmap containing information about starts and stops of subscenes in the scenario.
private  void checkSuspiciousDoubleAction(java.lang.String doubleActionId, java.lang.String fileName)
          This method check if id of the double action is suspicious one and if yes, it will be logged in the object, so we know which log contained the susp. double action.
private  boolean checkSuspiciousDoubleSubscene(java.lang.String previousSceneId, java.lang.String sceneId)
          Returns true if double subscene is considered suspicious.
private  boolean checkSuspiciousFeelingResults(java.lang.String sceneName, FeelingSceneResult feelResult)
          If the feeling result or subscene is consideres suspicious true will be returned.
private  boolean isAlowed(java.lang.String sceneId)
           
private  boolean listsEquals(java.util.ArrayList<java.lang.Integer> subsceneSerie, java.util.ArrayList<java.lang.Integer> setId)
          Used to match two subScene series lists if they are the same or not.
static void main(java.lang.String[] args)
          Main method - can be executed.
 void makeAgentActionsLog(AgentLogging agLog, java.lang.String directory)
          Logs all agent actions toward someone to the file.
 void makeAgentActionsProposalsSubscenesPlot(AgentLogging agLog, java.lang.String directory)
          Creates plot containing actions and proposals agent made to someone also with subscenes.
 void makeAgentDoubleActionLogs(java.lang.String directory)
          Makes double action txt log file for all the experiments.
private  void makeAgentEventsFeelingDifferencePlot(java.lang.String directory, java.lang.String agentName)
          Some analysis of feeling difference for all emotion events.
 void makeAgentPositionLog(AgentLogging agLog, java.lang.String directory)
          Logs agent location and rotation in time.
 void makeAgentProposalsLog(AgentLogging agLog, java.lang.String directory)
          Logs all proposals to the file.
 void makeAgentStatePlot(AgentLogging agLog, java.lang.String directory)
          Makes state transition plot, agent positions plot, agentWith plot and agent interrupters plot all-in-one.
private  void makeAgentSubscenesFeelingDifferencesAnalysis(java.lang.String directory, java.lang.String agentName)
          Plots feeling differences for each sub-scene in the scenario in a box plot graph.
private  void makeAgentSubscenesFeelingEndValueAnalysis(java.lang.String directory, java.lang.String agentName)
          Plots feeling end values for each sub-scene in the scenario in a box plot graph.
private  void makeAgentSubscenesFeelingRangesAnalysis(java.lang.String directory, java.lang.String agentName)
          Plots feeling ranges (max differences between min and max values during sub-scene) for each sub-scene in the scenario in a box plot graph.
 void makeBasicEmotionsPlot(AgentLogging agLog, java.lang.String directory)
          Makes basic emotions plot for input AgentLogging object.
 void makeCombinedFeelingPlot(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<FeelingLog>>> inputFeelings, java.lang.String outputFile)
          Makes combined feeling plot showing the feeling value development for all agents in one scenario.
 void makeComplexEmotionsPlot(AgentLogging agLog, java.lang.String directory)
          Makes complex emotions plot for input AgentLogging object.
 void makeEmotionEventsLog(AgentLogging agLog, java.lang.String directory)
          Makes emotion events txt log file from input AgentLogging object.
 void makeEmotionEventsPlot(AgentLogging agLog, java.lang.String directory)
          Makes emotion events plot for input AgentLogging object.
private  void makeEndFeelingsAnalyzeLog(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<FeelingLog>>> inputFeelings, java.lang.String fileName)
          Process feelings at the end of the scenario.
 void makeFeelingMoodPlot(AgentLogging agLog, java.lang.String directory)
          Makes feeling plot for input AgentLogging object.
private  void makeMissedActionsLog(java.lang.String directory)
          Logs all missed actions during all of experiments.
 void makePositionPlot(AgentLogging agLog, java.lang.String directory)
          Makes basic traversed positions plot.
private  void makeSubscenesDurationBoxPlot(java.lang.String directory)
          Creates boxplot with subscenes durations.
 void makeSubsceneSeriesAnalyzeLogs(java.lang.String directory)
          Makes subscene string analyze and double subscenes analyze.
private  void processDoubleActions(AgentLogging agLog)
          Makes double actions analysis for whole scenario.
 void processLogFile(java.lang.String fileName)
          Loads AgentLogging object from file and calls all desired file/graph exporting methods.
private  void processSubscenesDoubleActions(java.util.HashMap<java.lang.String,org.jfree.data.Range> subscenes, AgentLogging agLog)
          Will store double actions in subscenes into agentSubscenesDoubleActions variable for supported input.
static java.lang.String saveChartToFile(org.jfree.chart.JFreeChart chart, java.lang.String fileName, int width, int height)
          Save chart to file in PNG format.
private  void setSuspiciousDoubleActionsAndSubscenes()
          Sets suspicious double actions and store it into suspiciousDoubleActions HashMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cinemaLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location cinemaLocation
Cinema location


meetingCinemaLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location meetingCinemaLocation
This should point in front of the cinema


boyHomeLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location boyHomeLocation
Boy home location


firstGirlHomeLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location firstGirlHomeLocation
First girl home location - for Anne.


secondGirlHomeLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location secondGirlHomeLocation
First girl home location - for Clementine.


parkLocation

public cz.cuni.amis.pogamut.base3d.worldview.objects.Location parkLocation
Park location


obj

public java.lang.Object obj

bAllowFrames

static final boolean bAllowFrames
See Also:
Constant Field Values

subsceneFeelingDifferences

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> subsceneFeelingDifferences
Used in analyzeScenario method. first string - who this is for anne/bruno/clem, second string - sceneId, third string - targetAgent - name of the agent the feelings are


subsceneFeelingEndValue

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> subsceneFeelingEndValue
Filled in analyse scenario. Stores the subscene end feeling.


subsceneFeelingsFileLog

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> subsceneFeelingsFileLog
same as above, except the first key is actual fileLog name


subsceneFeelingRanges

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> subsceneFeelingRanges
Used in analyzeScenario method.


eventsFeelingDifferences

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Double>>>> eventsFeelingDifferences

agentNamesMap

java.util.HashMap<java.lang.Integer,java.lang.String> agentNamesMap
We will use this for proposals plotting, filled with makeAgenProposal method required for complex emotions plot


subsceneIdIntMap

java.util.HashMap<java.lang.String,java.lang.Integer> subsceneIdIntMap
This is for mapping subscene Ids to int so we can manipulate with it better


subsceneStrings

java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Integer>> subsceneStrings
Here we store all subscene strings for all agLog files. identifier is the name of agLog file, the value is subscene string


subsceneIntId

public int subsceneIntId

agentSubscenesDoubleActions

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>>> agentSubscenesDoubleActions
Here we store two succesive actions (double actions) of one character to another character.


agentDoubleActions

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> agentDoubleActions

agentSubscenesActionCounts

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>>> agentSubscenesActionCounts

agentActionCounts

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>> agentActionCounts

subscenesDurations

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Double>> subscenesDurations
Here we store the durations of subscens for each log file (first hash map key). The sceneId(complete - also with time) is the second HashMap key.


suspiciousDoubleActions

java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> suspiciousDoubleActions
Idexed by pre-defined suspicious double actions ID, the list contains the filenames of agentLog files that contains these suspicous doubleactions...


suspiciousDoubleSubscenes

java.util.HashMap<java.lang.String,java.lang.Boolean> suspiciousDoubleSubscenes
Indexed by suspicious double subscenes. Store info about which double subscenes are suspicious.


suspiciousFeelingDifference

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Double>> suspiciousFeelingDifference
This is indexed by agentLog filename, then there is a list of either subscens id with suspicious value and/or event id with suspicious value. These suspicous values are predefined in one method here.


agLogFeelings

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<FeelingLog>>>> agLogFeelings
Here we store feeling information from all of the experiments.


agLogCache

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,AgentLogging>> agLogCache
Here we store all three agLog files containing the complete info for one experiment. Indexed by agLogIndex, than agentName.


missedActionsCount

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>> missedActionsCount
Here we store global statistcis for each agent about number of actions he missed - did not perceived.

Constructor Detail

AgentLogProcessor

public AgentLogProcessor()
Method Detail

createCategoryChart

private static org.jfree.chart.JFreeChart createCategoryChart(java.lang.String chartTitle,
                                                              java.lang.String xAxisName,
                                                              java.lang.String yAxisName,
                                                              org.jfree.data.category.CategoryDataset dataset,
                                                              double lowerRange,
                                                              double upperRange)
Creates category chart.

Parameters:
chartTitle - chart title
xAxisName - x axis name
yAxisName - y axis name
dataset - dataset
Returns:
new bar JFreeChart

analyzeScenario

public void analyzeScenario(AgentLogging agLog,
                            java.lang.String directory)
                     throws java.io.IOException
Analyze scenario regarding feelings, double actions strings, subscenes string and feeling development. Store the outcomes into internal variables. (we use here getSubcenes method).

Parameters:
agLog -
directory -
Throws:
java.io.IOException

createLineChart

private static org.jfree.chart.JFreeChart createLineChart(java.lang.String chartTitle,
                                                          java.lang.String xAxisName,
                                                          java.lang.String yAxisName,
                                                          org.jfree.data.xy.XYDataset dataset,
                                                          boolean bAutoRange,
                                                          double lowerRange,
                                                          double upperRange)
Creates line chart. Force auto range of range axis, if bAutoRange true, if not will use lowerRange and upperRange parameters for setting up the range.

Parameters:
chartTitle -
xAxisName -
yAxisName -
dataset -
bAutoRange -
lowerRange -
upperRange -
Returns:

analyzeMissedActions

private void analyzeMissedActions(java.util.HashMap<java.lang.String,AgentLogging> inputAgLogs,
                                  java.lang.String agLogIndex,
                                  java.lang.String directory)
                           throws java.io.IOException
Here we will log missed actions for the experiment in a log file and we will store the numbers into global statistics file.

Parameters:
inputAgLogs -
agLogIndex -
directory -
Throws:
java.io.IOException

analyzeSubsceneFeelings

private java.util.Collection<FeelingSceneResult> analyzeSubsceneFeelings(AgentLogging agLog,
                                                                         double lowerBound,
                                                                         double upperBound)
Analyze one subscene feelings - how they were developing.

Parameters:
agLog -
lowerBound -
upperBound -
Returns:

checkSuspiciousDoubleAction

private void checkSuspiciousDoubleAction(java.lang.String doubleActionId,
                                         java.lang.String fileName)
This method check if id of the double action is suspicious one and if yes, it will be logged in the object, so we know which log contained the susp. double action.

Parameters:
doubleActionId - id of the double action
fileName - log that contained it

checkSuspiciousDoubleSubscene

private boolean checkSuspiciousDoubleSubscene(java.lang.String previousSceneId,
                                              java.lang.String sceneId)
Returns true if double subscene is considered suspicious.

Parameters:
previousSceneId -
sceneId -
Returns:

checkSuspiciousFeelingResults

private boolean checkSuspiciousFeelingResults(java.lang.String sceneName,
                                              FeelingSceneResult feelResult)
If the feeling result or subscene is consideres suspicious true will be returned.

Parameters:
sceneName -
feelResult -
Returns:

createBoxAndWhiskerCategoryPlot

private org.jfree.chart.plot.CategoryPlot createBoxAndWhiskerCategoryPlot(java.lang.String xAxisName,
                                                                          java.lang.String yAxisName,
                                                                          org.jfree.data.statistics.BoxAndWhiskerCategoryDataset dataset)
Creates box plot graph.

Parameters:
xAxisName -
yAxisName -
dataset -
Returns:

createCombinedCategoryChart

private org.jfree.chart.JFreeChart createCombinedCategoryChart(java.lang.String chartTitle,
                                                               java.lang.String firstXAxisName,
                                                               org.jfree.data.category.CategoryDataset firstDataset,
                                                               double lowerRange,
                                                               double upperRange,
                                                               java.lang.String secondXAxisName,
                                                               org.jfree.data.category.CategoryDataset secondDataset,
                                                               java.lang.String domainAxisName,
                                                               double leftOffset)
Creates combined category chart - two graphs in one.

Parameters:
chartTitle -
firstXAxisName -
firstDataset -
lowerRange -
upperRange -
secondXAxisName -
secondDataset -
domainAxisName -
leftOffset -
Returns:

createCategoryPlot

private org.jfree.chart.plot.CategoryPlot createCategoryPlot(java.lang.String plotName,
                                                             java.lang.String rangeAxisName,
                                                             java.lang.String domainAxisName,
                                                             double lowerRange,
                                                             double upperRange,
                                                             org.jfree.data.category.CategoryDataset dataset,
                                                             double leftOffset)
Creates one Category plot - used when creating multigraphs.

Parameters:
rangeAxisName -
domainAxisName -
lowerRange -
upperRange -
dataset -
Returns:

createXYPlot

private org.jfree.chart.plot.XYPlot createXYPlot(java.lang.String plotName,
                                                 java.lang.String rangeAxisName,
                                                 java.lang.String domainAxisName,
                                                 double lowerRange,
                                                 double upperRange,
                                                 org.jfree.data.xy.XYDataset dataset)
Creates one XYPlot.

Parameters:
rangeAxisName -
domainAxisName -
lowerRange -
upperRange -
dataset -
Returns:

makeEmotionEventsLog

public void makeEmotionEventsLog(AgentLogging agLog,
                                 java.lang.String directory)
                          throws java.io.IOException
Makes emotion events txt log file from input AgentLogging object. Also logs the feelings to the object used for all scenarios statisctical analysis.

Parameters:
agLog - input agent logging object
directory - output directory
Throws:
java.io.IOException

makeEmotionEventsPlot

public void makeEmotionEventsPlot(AgentLogging agLog,
                                  java.lang.String directory)
                           throws java.io.IOException
Makes emotion events plot for input AgentLogging object.

Parameters:
agLog - input agent logging object
directory - output directory
Throws:
java.io.IOException

makeAgentActionsLog

public void makeAgentActionsLog(AgentLogging agLog,
                                java.lang.String directory)
                         throws java.io.IOException
Logs all agent actions toward someone to the file.

Parameters:
agLog -
directory -
Throws:
java.io.IOException

makeAgentProposalsLog

public void makeAgentProposalsLog(AgentLogging agLog,
                                  java.lang.String directory)
                           throws java.io.IOException
Logs all proposals to the file.

Parameters:
agLog -
directory -
Throws:
java.io.IOException

makeAgentActionsProposalsSubscenesPlot

public void makeAgentActionsProposalsSubscenesPlot(AgentLogging agLog,
                                                   java.lang.String directory)
                                            throws java.io.IOException
Creates plot containing actions and proposals agent made to someone also with subscenes.

Parameters:
agLog -
directory -
Throws:
java.io.IOException

makeSubsceneSeriesAnalyzeLogs

public void makeSubsceneSeriesAnalyzeLogs(java.lang.String directory)
                                   throws java.io.IOException
Makes subscene string analyze and double subscenes analyze. Also suspicous double subscenes and suspicious subscenes durations will be logged. More log files will be output of this method.

Parameters:
directory -
Throws:
java.io.IOException

makeBasicEmotionsPlot

public void makeBasicEmotionsPlot(AgentLogging agLog,
                                  java.lang.String directory)
                           throws java.io.IOException
Makes basic emotions plot for input AgentLogging object.

Parameters:
agLog - input AgentLogging object
directory - output directory
Throws:
java.io.IOException

makeComplexEmotionsPlot

public void makeComplexEmotionsPlot(AgentLogging agLog,
                                    java.lang.String directory)
                             throws java.io.IOException
Makes complex emotions plot for input AgentLogging object.

Parameters:
agLog - input AgentLogging object
directory - output directory
Throws:
java.io.IOException

makeAgentDoubleActionLogs

public void makeAgentDoubleActionLogs(java.lang.String directory)
                               throws java.io.IOException
Makes double action txt log file for all the experiments. Double actions in subscenes will be logged, also with double actions in whole scenario. Moreover suspicious double actions will be logged as well. Three text files will be the output of this method.

Parameters:
directory - output directory
Throws:
java.io.IOException

analyzeFeeling

public void analyzeFeeling(AgentLogging agLog,
                           java.lang.String directory)
                    throws java.io.IOException
Makes feeling txt log file for input AgentLogging object. Also looks if we have all necessary vars for generating combined plot. If yes, we will make the combined plot for all the three experiments.

Parameters:
agLog - input AgentLogging object
directory - output directory
Throws:
java.io.IOException

makeFeelingMoodPlot

public void makeFeelingMoodPlot(AgentLogging agLog,
                                java.lang.String directory)
                         throws java.io.IOException
Makes feeling plot for input AgentLogging object.

Parameters:
agLog - input AgentLogging object
directory - output directory
Throws:
java.io.IOException

makeCombinedFeelingPlot

public void makeCombinedFeelingPlot(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<FeelingLog>>> inputFeelings,
                                    java.lang.String outputFile)
                             throws java.io.IOException
Makes combined feeling plot showing the feeling value development for all agents in one scenario.

Parameters:
inputFeelings -
outputFile -
Throws:
java.io.IOException

makeAgentPositionLog

public void makeAgentPositionLog(AgentLogging agLog,
                                 java.lang.String directory)
                          throws java.io.IOException
Logs agent location and rotation in time.

Parameters:
agLog -
directory -
Throws:
java.io.IOException

makePositionPlot

public void makePositionPlot(AgentLogging agLog,
                             java.lang.String directory)
                      throws java.io.IOException
Makes basic traversed positions plot.

Parameters:
agLog -
directory -
Throws:
java.io.IOException

generateOneByOneList

private java.util.List generateOneByOneList(org.jfree.data.Range range)
Generate list of values for scatter plot.

Parameters:
range -
Returns:

getPosition

private java.lang.String getPosition(LocationLog locLog)
Returns the scenario place our agent is at.

Parameters:
loc -
Returns:

makeAgentStatePlot

public void makeAgentStatePlot(AgentLogging agLog,
                               java.lang.String directory)
                        throws java.io.IOException
Makes state transition plot, agent positions plot, agentWith plot and agent interrupters plot all-in-one.

Parameters:
agLog -
directory -
Throws:
java.io.IOException

processLogFile

public void processLogFile(java.lang.String fileName)
Loads AgentLogging object from file and calls all desired file/graph exporting methods.

Parameters:
fileName -

saveChartToFile

public static final java.lang.String saveChartToFile(org.jfree.chart.JFreeChart chart,
                                                     java.lang.String fileName,
                                                     int width,
                                                     int height)
                                              throws java.io.IOException
Save chart to file in PNG format.

Parameters:
chart - JFreeChart.
fileName - Name of PNG file.
width - Width of PNG image.
height - Height of PNG image.
Returns:
Final file name used.
Throws:
java.io.IOException - on error.

main

public static void main(java.lang.String[] args)
Main method - can be executed. Construct this objects and process the agentLogging log files at given destination.

Parameters:
args -

getSceneId

private java.lang.String getSceneId(java.lang.Integer i)
Gets the sceneName from integer, uses subsceneIdIntMap.

Parameters:
i - input scene
Returns:
scene name

getSubscene

private java.lang.String getSubscene(AgentStateLog stateLog)
Returns name of the subscene the agentState corresponds to.

Parameters:
stateLog -
Returns:

getSubsceneActions

private java.util.HashMap<java.lang.String,java.util.ArrayList<ActionLog>> getSubsceneActions(org.jfree.data.Range range,
                                                                                              AgentLogging agLog)
Gets list of actions during one supported agent subscene.

Parameters:
range -
agLog -
Returns:
list of actions

getSubscenes

private java.util.HashMap<java.lang.String,org.jfree.data.Range> getSubscenes(AgentLogging agLog,
                                                                              double minimalLength)
Returns hashmap containing information about starts and stops of subscenes in the scenario. Also it stores the information about subscene string for this log file into global object for further analysis!

Parameters:
agLog -
Returns:

isAlowed

private boolean isAlowed(java.lang.String sceneId)

listsEquals

private boolean listsEquals(java.util.ArrayList<java.lang.Integer> subsceneSerie,
                            java.util.ArrayList<java.lang.Integer> setId)
Used to match two subScene series lists if they are the same or not.

Parameters:
subsceneSerie -
setId -
Returns:

makeAgentSubscenesFeelingDifferencesAnalysis

private void makeAgentSubscenesFeelingDifferencesAnalysis(java.lang.String directory,
                                                          java.lang.String agentName)
                                                   throws java.io.IOException
Plots feeling differences for each sub-scene in the scenario in a box plot graph.

Throws:
java.io.IOException

makeAgentSubscenesFeelingEndValueAnalysis

private void makeAgentSubscenesFeelingEndValueAnalysis(java.lang.String directory,
                                                       java.lang.String agentName)
                                                throws java.io.IOException
Plots feeling end values for each sub-scene in the scenario in a box plot graph.

Throws:
java.io.IOException

makeAgentSubscenesFeelingRangesAnalysis

private void makeAgentSubscenesFeelingRangesAnalysis(java.lang.String directory,
                                                     java.lang.String agentName)
                                              throws java.io.IOException
Plots feeling ranges (max differences between min and max values during sub-scene) for each sub-scene in the scenario in a box plot graph.

Throws:
java.io.IOException

makeAgentEventsFeelingDifferencePlot

private void makeAgentEventsFeelingDifferencePlot(java.lang.String directory,
                                                  java.lang.String agentName)
                                           throws java.io.IOException
Some analysis of feeling difference for all emotion events. Feeling difference between feeling values at the time of the event and at one second after the event.

Throws:
java.io.IOException

makeEndFeelingsAnalyzeLog

private void makeEndFeelingsAnalyzeLog(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<FeelingLog>>> inputFeelings,
                                       java.lang.String fileName)
                                throws java.io.IOException
Process feelings at the end of the scenario.

Parameters:
inputFeelings -
fileName -
Throws:
java.io.IOException

makeMissedActionsLog

private void makeMissedActionsLog(java.lang.String directory)
                           throws java.io.IOException
Logs all missed actions during all of experiments.

Parameters:
string -
Throws:
java.io.IOException

makeSubscenesDurationBoxPlot

private void makeSubscenesDurationBoxPlot(java.lang.String directory)
                                   throws java.io.IOException
Creates boxplot with subscenes durations.

Parameters:
agLog -
directory -
Throws:
java.io.IOException

processDoubleActions

private void processDoubleActions(AgentLogging agLog)
Makes double actions analysis for whole scenario. The maximum delay between double action is 15 seconds.

Parameters:
agLog -

processSubscenesDoubleActions

private void processSubscenesDoubleActions(java.util.HashMap<java.lang.String,org.jfree.data.Range> subscenes,
                                           AgentLogging agLog)
Will store double actions in subscenes into agentSubscenesDoubleActions variable for supported input.

Parameters:
subscenes -
agLog -

setSuspiciousDoubleActionsAndSubscenes

private void setSuspiciousDoubleActionsAndSubscenes()
Sets suspicious double actions and store it into suspiciousDoubleActions HashMap. Also sets suspicious double subcenes and store them in suspiciousDoubleSubscenes.