|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectyass.analysis.Analyser
yass.analysis.FullAnalyser
public class FullAnalyser
Analyses a provided simulation state to frequentYielding statistics focussing on energy consumption. TODO: This analyser should be modularised, being transformed into a set of complementary but orthogonal smaller analysers. Not diffcult to do, but nevertheless has not yet been done.
| Field Summary | |
|---|---|
protected long |
analysisStartTimeMillis
Result of System.currentTimeMillis() at start of analysis; used to calculate how long has been spent during analysis |
protected Database |
db
Simulation database |
protected double |
endTime
Total elapsed simulated time |
protected PacketType |
generatedTypeToConsider
Type of generated packet on which to filter analysis. |
protected java.util.Map<java.lang.Integer,Node> |
idNodeMap
Mapping of node ID number to associated Node object |
private static org.apache.log4j.Logger |
log
The logger |
protected Node[] |
nodes
Nodes participating in the simulated network |
protected java.lang.String |
nodeStateTable
Name of database table to hold temporary data when analysing node states, specific to this instance |
static java.lang.String |
nodeStateTablePrefix
Name of database table to hold temporary data when analysing node states; prefix used for each instance |
protected boolean |
performCoverageAnalysis
Flag indicating if optional packet coverage analysis is to be performed. |
protected boolean |
performDeliveryDistributionAnalysis
Flag indicating if optional delivery distribution analysis is to be performed. |
static int |
propagationAnalysisIncrements
Number of steps to consider between 0% propagation and 100% propagation |
protected java.lang.String |
propagationTargetsTable
Name of database table to hold temporary data when analysing message propagation targets, specific to this instance |
static java.lang.String |
propagationTargetsTablePrefix
Name of database table to hold temporary data when analysing message propagation targets; prefix used for each instance |
protected java.lang.String |
propagationTimesTable
Name of database table to hold temporary data when analysing message propagation critical times, specific to this instance |
static java.lang.String |
propagationTimesTablePrefix
Name of database table to hold temporary data when analysing message propagation critical times; prefix used for each instance |
protected java.lang.String |
rmStateTable
Name of database table to hold temporary data when analysing radio module states, specific to this instance |
static java.lang.String |
rmStateTablePrefix
Name of database table to hold temporary data when analysing radio module states; prefix used for each instance |
protected java.lang.String |
tableSuffix
Instance-specific unique suffix appended to all shared tablename prefixes to guarantee that analyser instances never share temporary working data. |
protected java.text.NumberFormat |
twoDpNumberFormat
Number formatter which rounds floats and doubles to two decimal places |
| Fields inherited from class yass.analysis.Analyser |
|---|
analysisFinished, results, simulation, simulationState |
| Constructor Summary | |
|---|---|
FullAnalyser(Simulation state)
Creates a new instance of FullAnalyser |
|
FullAnalyser(Simulation state,
PacketType generatedTypeToConsider,
boolean performCoverageAnalysis,
boolean performDeliveryDistributionAnalysis)
Creates a new instance of FullAnalyser |
|
| Method Summary | |
|---|---|
AnalysisResults |
analyse()
Analyses the current simulation state |
protected void |
analyseDeliveryDistributions()
Analyses distributions of metrics associated with packet delivery success and failure, from which investigators can derive an understanding of where failures in message delivery are concentrated. |
protected void |
analyseEnergy()
Analyses the energy consumed by simulated network activity |
protected void |
analyseMessagePropagation()
Analyses success of message propagation within the simulated network |
protected void |
analyseNetwork()
Analyses the network and its participating nodes |
protected void |
analyseNetworkTraffic()
Analyses traffic in the simulated network |
protected void |
analyseNetworkTrafficEnergy()
Analyses energy expended on traffic in the simulated network |
protected void |
analyseNodeStates()
Analyses the states adopted by nodes during simulation |
protected void |
analysePointToPointSuccess()
Analyses success of point-to-point activity in the simulated network |
protected void |
analyseRadioModuleStates()
Analyses the states adopted by radio modules during simulation |
protected java.lang.String |
analysisTimeSeconds()
|
protected AnalysisException |
createException(java.lang.String message,
java.lang.Exception e)
Builds an AnalysisException to wrap the provided message and lower-level exception |
protected void |
createWorkingTables()
Creates the set of temporary tables to hold working data required during analysis, which can be safely discarded when analysis completes. |
protected boolean |
dropWorkingTables()
Drops the temporary analysis working tables from the simulation database if the backing Database object is configured to drop tables on shutdown. |
private void |
initialiseNumberFormatters()
|
protected void |
logCumulativeTime(java.lang.String reason,
long prev)
Logs the number of seconds spent on analysis thus far |
protected void |
populateNodeMap()
Populates the mapping of nodeId to node, and populates the node-bearing array, for all nodes supplied in the class constructor |
protected void |
populateNodeWorkingTables()
Populates temporary working data tables with data used in later analysis of nodes participating in the simulated network |
protected void |
populatePropagationWorkingTables()
Populates temporary working tables with data to be used in the later analysis of propagation of packets within the simulated network |
protected void |
populateRadioModuleWorkingTables()
Populates temporary working data tables with data used in later analysis of radio modules participating in the simulated network |
| Methods inherited from class yass.analysis.Analyser |
|---|
getResults, getSimulationId, getState, isAnalysisFinished |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int propagationAnalysisIncrements
public static final java.lang.String rmStateTablePrefix
public static final java.lang.String nodeStateTablePrefix
public static final java.lang.String propagationTargetsTablePrefix
public static final java.lang.String propagationTimesTablePrefix
private static org.apache.log4j.Logger log
protected Node[] nodes
protected Database db
protected double endTime
protected java.util.Map<java.lang.Integer,Node> idNodeMap
protected java.lang.String rmStateTable
protected java.lang.String nodeStateTable
protected java.lang.String propagationTargetsTable
protected java.lang.String propagationTimesTable
protected java.lang.String tableSuffix
protected boolean performCoverageAnalysis
protected boolean performDeliveryDistributionAnalysis
protected PacketType generatedTypeToConsider
protected long analysisStartTimeMillis
protected java.text.NumberFormat twoDpNumberFormat
| Constructor Detail |
|---|
public FullAnalyser(Simulation state)
FullAnalyser
state - the simulation state to analyse
public FullAnalyser(Simulation state,
PacketType generatedTypeToConsider,
boolean performCoverageAnalysis,
boolean performDeliveryDistributionAnalysis)
FullAnalyser
generatedTypeToConsider - the type of packet to consider in
analysis (or PacketType.UNSPECIFIED to consider all
packet types equally)state - the simulation state to analyseperformCoverageAnalysis - whether to perform optional packet
coverage analysis, which can be disabled for faster analysis if the
results are not requiredperformDeliveryDistributionAnalysis - whether to perform optional
delivery distribution analysis, which can be disabled for faster analysis
if the results are not required| Method Detail |
|---|
private void initialiseNumberFormatters()
public AnalysisResults analyse()
throws AnalysisException
analyse in class AnalyserAnalysisException - if analysis cannot be completed successfullyprotected java.lang.String analysisTimeSeconds()
protected void logCumulativeTime(java.lang.String reason,
long prev)
prev - the previous number of millis before the current analytical
phase of interest began.reason - the reason for logging this timeprotected void populateNodeMap()
protected AnalysisException createException(java.lang.String message,
java.lang.Exception e)
message - the message describing the probleme - the lower-level exception
protected void analyseNetwork()
protected void analyseEnergy()
throws java.sql.SQLException
java.sql.SQLException - if the database is unusable
protected void analyseNodeStates()
throws java.sql.SQLException
java.sql.SQLException - if the simulation database cannot be used
protected void analyseRadioModuleStates()
throws java.sql.SQLException
java.sql.SQLException - if the simulation database cannot be used
protected void analyseNetworkTraffic()
throws java.sql.SQLException
java.sql.SQLException - if the simulation database cannot be usedprotected void analyseNetworkTrafficEnergy()
protected void analysePointToPointSuccess()
throws java.sql.SQLException
java.sql.SQLException - if the simulation database cannot be used
protected void analyseDeliveryDistributions()
throws java.sql.SQLException
java.sql.SQLException - if the simulation database cannot be used
protected void analyseMessagePropagation()
throws java.sql.SQLException
java.sql.SQLException - if the simulation database cannot be used
protected void createWorkingTables()
throws java.sql.SQLException
java.sql.SQLException - if the tables and indexes cannot be created in
the simulation database
protected boolean dropWorkingTables()
throws java.sql.SQLException
java.sql.SQLException - if the tables cannot be dropped from the
simulation database
protected void populatePropagationWorkingTables()
throws java.sql.SQLException
java.sql.SQLException - if the simulation database cannot be used
protected void populateNodeWorkingTables()
throws java.sql.SQLException
java.sql.SQLException - if the simulation database cannot be used
protected void populateRadioModuleWorkingTables()
throws java.sql.SQLException
java.sql.SQLException - if the simulation database cannot be used
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||