api¶
-
class
rail.CPI¶ Bases:
objectA class to retrieve United States CPI data and calculate inflation
-
inflation(from_year: int, to_year: int) → float¶ A method to retrieve United States CPI data and calculate inflation
-
-
class
rail.Control(name: str, cost: float, reduction: float, implemented: bool = True)¶ Bases:
collections.UserDictA class to represent Controls
-
evaluate_lognormal(iterations=1)¶
-
-
class
rail.Controls¶ Bases:
collections.UserDictA class to hold multiple Controls
-
costs()¶ A method to compute the deterministic costs of implemented controls in a Controls class
-
costs_lognormal()¶ A method to compute the stochastic costs of implemented controls in a Controls class
-
new(name: str, cost: float, reduction: float) → rail.control.Control¶ A method to add a new controls to the Controls class
-
-
class
rail.Impact(name: str, mu: float, sigma: float)¶ Bases:
collections.UserDictA class to represent an Impact
-
from_lower_90_upper_90(lower_90: float, upper_90: float)¶ A method to create an impact from the lower 90th and upper 90th percentiles
-
plot(num=1000, axes=None) → list¶ A method to plot the impact
-
-
class
rail.Likelihood(lam: float)¶ Bases:
collections.UserDictA class to represent a Likelihood
-
plot(axes=None) → tuple¶ A method to plot the likelihood
-
-
class
rail.Risk(vulnerability: rail.vulnerability.Vulnerability, likelihood: rail.likelihood.Likelihood, impact: rail.impact.Impact)¶ Bases:
collections.UserDict-
evaluate_deterministic() → float¶
-
evaluate_lognormal(iterations: int = 1000) → float¶
-
-
class
rail.Risks¶ Bases:
collections.UserDict-
calculate_dataframe_deterministic_mean()¶
-
calculate_stochastic_risks(interations: int = 100000)¶
-
determine_optimum_controls(controls, controls_to_optimize, stochastic=False)¶
-
expected_loss_deterministic_mean() → float¶
-
expected_loss_stochastic_mean(interations: int = 1000) → float¶
-
new(vulnerability: rail.vulnerability.Vulnerability, likelihood: rail.likelihood.Likelihood, impact: rail.impact.Impact) → rail.risk.Risk¶
-
plot(axes=None)¶
-
plot_risk_cost_matrix(controls, axes=None)¶
-
sensitivity_test(controls, iterations=1000)¶
-
set_optimum_controls(controls)¶
-
-
class
rail.ThreatEvent(name: str, threat_source: rail.threat_source.ThreatSource)¶ Bases:
collections.UserDictA class to represent Threat Events
-
class
rail.ThreatEvents(**kwargs)¶ Bases:
collections.UserDictA class to hold multiple Threat Events
-
new(name: str, threat_source: rail.threat_source.ThreatSource) → rail.threat_event.ThreatEvent¶ A method to add a new threat event to the Threat Events class
-
-
class
rail.ThreatSource(name: str)¶ Bases:
collections.UserDictA class to represent Threat Sources
-
class
rail.ThreatSources(**kwargs)¶ Bases:
collections.UserDictA class to hold multiple Threat Sources
-
new(name: str) → rail.threat_source.ThreatSource¶ A method to add a new threat source to the Threat Sources class
-
-
class
rail.Tree(name: str, parent=None, sort: bool = True)¶ Bases:
collections.UserDictA class to implement a tree structure
-
add_child(name: str) → rail.tree.Tree¶ Add a child to the tree
-
path() → str¶ Print the path from the root to the child
-
to_dict_list() → dict¶ Print a tree in an alternating dict list format
-
to_latex() → None¶ Print a tree in LaTeX format
-
to_print() → None¶ Print all of a tree
-
-
class
rail.Vulnerabilities(**kwargs)¶ Bases:
collections.UserDictA class to hold multiple Vulnerabilities
-
new(threat_event: rail.threat_event.ThreatEvent, system: rail.tree.Tree, controls: [<class 'rail.control.Control'>] = []) → rail.vulnerability.Vulnerability¶
-
-
class
rail.Vulnerability(threat_event: rail.threat_event.ThreatEvent, system: rail.tree.Tree, controls: [<class 'rail.control.Control'>] = [])¶ Bases:
collections.UserDictA class to represent Vulnerabilities