Commit cae19c5c authored by Argyris Kalogeratos's avatar Argyris Kalogeratos

Spell-checking comments

parent f1576271
......@@ -95,7 +95,7 @@ end
toc;
%% COMPUTE AND SHOW METRICS
fResults = invertCellStruct(results); % make a strcture with proper format for exploring the results
fResults = invertCellStruct(results); % make a structure with proper format for exploring the results
fResults = applyMetric(fResults, @(s) 100 * double(s.numInfected) / graphPars.N, 'percentageInfected');
fResults = applyMetric(fResults, @(s) 100 * double(s.numInfected(end)) / graphPars.N, 'finalPercentageInfected');
fResults = applyMetric(fResults, @(s) sum(s.numInfected) * simulationPars.timeStep, 'AUC');
......
......@@ -12,7 +12,7 @@
% - metricName: the name of computed evaluation metric.
%
% Output:
% - sResult: the udated structure with the simulation results.
% - sResult: the updated structure with the simulation results.
%---
% This is part of the DRA Simulator package for Dynamic Resource Allocation
% strategies aiming to suppress SIS epidemics. See the comments header
......
......@@ -68,7 +68,7 @@ Project contents:
`./EvalMetric/*`
> functions that compute the evaluation metrics used to asses the quality of the compaired control strategies.
> functions that compute the evaluation metrics used to asses the quality of the compared control strategies.
`./GraphModels/*`
......
%createStrategies - This function creates one structure storing all the
%settings for the comtrol strategies that wil be simulated.
%settings for the control strategies that will be simulated.
%
% function strategies = createStrategies (btot, varargin)
%
......@@ -16,7 +16,7 @@
% randomly chosen nodes. Note that this is a naive dynamic strategy
% which decides at random each time an event happens (infection/recovery).
% --<Static strategies>--
% > 'RANDFIXED': it fixes the btot treatments to randomly selected
% > 'RANDFIXED': it fixes the btot treatments to be randomly selected
% nodes and keep it this way throughout all the simulation.
% > 'MN': favors the treatment of the nodes with most neighbors (high degree nodes).
% > 'LN': favors the treatment of the nodes with least neighbors (low degree nodes).
......@@ -25,7 +25,7 @@
% > 'MSN' : the treatment resources are given to the btot nodes that
% have the most susceptible neighbors (i.e. to the most viral nodes)
% > 'LIN' : the treatment resources are given to the btot nodes that
% have the least infected neighbors (i.e. to the most safe nodes)
% have the least infected neighbors (i.e. to the safest nodes)
% > 'LRIE': it roughly combines MSN and LIN. This is the optimal greedy
% control strategy.
%
......
%dropInMaxEigenValueApprox - An appriximation algorithm for the computation
%dropInMaxEigenValueApprox - An approximation algorithm for the computation
%of a score for each node that represents the drop of in the max eigenvalue
%observed after removing that node from the graph.
%
......
%preferentialStrategy - It creates a strategy object for those strategies
%that apply a preferencial selection of nodes to distribute resources,
%that apply a preferential selection of nodes to distribute resources,
%according to a score function. Given an ordering of the nodes (specified
%by a score for each node), it selects the btot first out of them (that are
%also infected if amongInfected is set to true).
......
......@@ -10,7 +10,7 @@
% - strategyInternalState: a structure with all the internal information
% of the strategy state.
% - btot: the number of available treatment resources to distribute.
% - amongInfected: if true, it restict the distribution to resources to
% - amongInfected: if true, it restrict the distribution to resources to
% the infected nodes only.
%
% Output:
......@@ -72,4 +72,4 @@ end
treatments(idxToTreat(1:btot)) = true;
end
\ No newline at end of file
end
%invertCellStruct - A utility function that manipulates the original cell
%structure with the simulation results and makes a new structure with one
%field per compared cotrol strategy.
%field per compared control strategy.
%
% function s = invertCellStruct (c)
%
% Input:
% - c: the original cell marix storing simulation resuls.
% - c: the original cell matrix storing simulation results.
%
% Output:
% - s: a new structure with one filed per compared control strategy.
......
%parsepar - Processes the list if variable arguments (varargin) of a function.
%It seeks for a specific variable name in a par list (case-insesnsitive)
%It seeks for a specific variable name in a par list (case-insensitive)
%and returns the respective input value. It also returns an updated varlist
%without the matched field name and val for quicker further processing.
%
......
/* This mex file implements a random integer generator between elements 1...N
* according to an input weight vector that is treated as a probability vector
* (after considered the elements to be normalized wrt norm-1)
* Copyrigth (C) Argyris Kalogeratos, 2014.
* Copyright (c) Argyris Kalogeratos, 2014.
* ---
* This is part of the DRA Simulator package for Dynamic Resource Allocation
* strategies aiming to suppress SIS epidemics. See the comments header
......@@ -41,4 +41,4 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
for (i=0; i<dimx && r>pdf[i]/sum; i++)
;
*mxGetPr(plhs[0]) = i+1;
}
\ No newline at end of file
}
%varIntSize - Determines the type of integer variable needed in irder to
%varIntSize - Determines the type of integer variable needed in order to
%store values in [minv, maxv], signed or unsigned. This is used to make
% proper preallocation of memory space.
%
......
......@@ -45,7 +45,7 @@ for iCurves = 1:numCurves
end
% confidence intervals
if (showStd) % avoid shoing std around lines if only one experiment was done
if (showStd) % avoid showing std around lines if only one experiment was done
for iCurves = 1:numCurves
lowerBound = max(0, yMean(:, iCurves) - yStd(:, iCurves));
upperBound = min(100, yMean(:, iCurves) + yStd(:, iCurves));
......
......@@ -16,7 +16,7 @@
% - simulationPars: a structure with simulation settings.
% See simulateEpidemic() for more details.
% - varargin: a list of other optional arguments, here 'max_infected' is
% the infection level over which we may decide for the absorbant state
% the infection level over which we may decide for the absorbent state
% (this is for the stationarity test used as stopping criterion).
% Output:
% - epidemicEvolution: a structure with the recorded information during
......@@ -56,7 +56,7 @@ else updateInterval = @() -1; % will always update the resource allo
end
if (isfield(simulationPars, 'noSlopeT'))
noSlopeT = simulationPars.noSlopeT;
else noSlopeT = inf; % the stationarity test will be disactivated
else noSlopeT = inf; % the stationarity test will be deactivated
end
if (isfield(simulationPars, 'stateSnapshots'))
stateSnapshots = simulationPars.stateSnapshots;
......@@ -110,7 +110,7 @@ while (currentTime <= T && ~stopSimulation && iter <= msz)
transitionRate = sum(probTransition); % overall rate of events
% Absorbant state: the system is now static and we can stop
% Absorbent state: the system is now static and we can stop
if (transitionRate <= 0 || curNumInfected >= max_infected)
numInfected(iter) = curNumInfected;
if (stateSnapshots)
......@@ -170,7 +170,7 @@ end
%% SAVE RESULTS
iter = iter - 1; % the last iteration
range = 1:iter;
numInfected = numInfected(range); % keep the usefull part of the matrices
numInfected = numInfected(range); % keep the useful part of the matrices
timeSteps = timeSteps(range);
if (stateSnapshots)
stateSnapshot = stateSnapshot(:, range);
......
......@@ -27,7 +27,7 @@
% > .T : total simulation time (stopping criterion)
% > .noSlopeT: characteristic time for the non stationarity test used
% to determine when an experiment reached a saturation state. Set an
% Inf value to ignore this feature and simulatie up to total time T.
% Inf value to ignore this feature and simulate up to total time T.
% > .timeStep: the time interval for the recording the infection network
% state and other results (low values wrt T will reduce simulation speed).
% > .stateSnapshots: if true, then the treatment distribution and network
......@@ -37,7 +37,7 @@
% - strategies: a structure with the strategies to use in the simulations.
% See more details in the file createStrategies.m.
% - varargin: a list of other optional arguments, here 'verbosityLevel'
% indicates the the detail of reported information to the terminal.
% indicates the detail of reported information to the terminal.
%
% Output:
% - results: it is a structure with all the recorded information during
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment