Loading DRAsimulator.m +1 −1 Original line number Diff line number Diff line Loading @@ -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'); Loading EvalMetrics/applyMetric.m +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading README.md +1 −1 Original line number Diff line number Diff line Loading @@ -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/*` Loading Strategies/createStrategies.m +3 −3 Original line number Diff line number Diff line %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) % Loading @@ -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). Loading @@ -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. % Loading Strategies/dropInMaxEigenValueApprox.m +1 −1 Original line number Diff line number Diff line %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. % Loading Loading
DRAsimulator.m +1 −1 Original line number Diff line number Diff line Loading @@ -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'); Loading
EvalMetrics/applyMetric.m +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -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/*` Loading
Strategies/createStrategies.m +3 −3 Original line number Diff line number Diff line %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) % Loading @@ -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). Loading @@ -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. % Loading
Strategies/dropInMaxEigenValueApprox.m +1 −1 Original line number Diff line number Diff line %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. % Loading