std::vector<double> FragilityFn::pExceeded(double edp) { std::vector<double> result(n_states()); for (size_t i=0; i < n_states(); i++) { result[i] = damage_states[i].p_at_most(edp); } return result; }
std::vector<double> FragilityFn::pHighest(double edp) { std::vector<double> result = pExceeded(edp); for (size_t i=1; i < n_states(); i++) { result[i-1] -= result[i]; } return result; }
State::State(const std::string& name) : id_(n_states()), name_(name) { states_by_name_[name] = this; states_by_id_.push_back(this); }