R/NodesTargeted.R

Defines functions NodesTargeted

NodesTargeted <-function(NetworkList){
  #Gets the name of the deleted target node/edge from the named attribute in each attack list.
  #Networklist: a list of lists of networks. The output of Attack the grid

  Out <- NetworkList %>% 
    purrr::map(~ igraph::get.graph.attribute(.x[[1]], "Removed")) %>% 
    unlist(.) %>% 
    c("None", .) #adds on the first element where there was nothing deleted.
  return(Out)
  
}
JonnoB/PowerGridNetworking documentation built on Aug. 7, 2021, 3:04 a.m.