SaveMultiAttacks: Save attack simulations to folder

Description Usage Arguments See Also Examples

View source: R/SaveMultiAttacks.R

Description

When creating many attack simulations it can be conveniant to save the resulting graphs to a folder so that re-runs are not required if further analysis is needed. This function saves the results of AttackTheGrid, and also allows the process to be interrupted. When the process is started again after and interuption the function finds the last save attack and starts the simulation process from there.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
SaveMultiAttacks(
  g,
  AttackVectors,
  folder,
  MinMaxComp = 0,
  TotalAttackRounds = 10,
  CascadeMode = FALSE,
  Demand = "Demand",
  Generation = "Generation",
  EdgeName = "Link",
  VertexName = "name",
  Net_generation = "BalencedPower",
  Target = "Nodes"
)

Arguments

g

An igraph object representing a power grid.

AttackVectors

A dataframe. This is the output of the MultiAttackOrder function. If you expect. to interrupt the function this dataframe should be saved or the random seed used to generate the dataset recorded.

folder

the folder data will be saved to.

MinMaxComp

See AttackTheGrid. Default is 0

TotalAttackRounds

See AttackTheGrid. Default is 10

CascadeMode

See AttackTheGrid. Default is set to FALSE

Demand

the name of the node Load variable. A character string.

Generation

the name of the node generation variable. A character string.

EdgeName

the variable that holds the edge names, a character string.

VertexName

the variable that holds the names of the nodes, to identify the slack ref. a character string

Net_generation

the name that the net generation data for each node is held in

Target

whether nodes or edges are being attacked

See Also

attack_the_grid, MultiAttackOrder

Examples

1
SaveMultiAttacks(g, AttackVectors, folder, CascadeMode = F)

JonnoB/PowerGridNetworking documentation built on Aug. 7, 2021, 3:04 a.m.