Skip to content

Commit

Permalink
fixing some issues leading to segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Mar 22, 2024
1 parent c416771 commit b808c01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/element_container/DCLineContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void DCLineContainer::set_state(DCLineContainer::StateRes & my_state){
status_ = status;
loss_percent_ = RealVect::Map(&loss_percent[0], loss_percent.size());
loss_mw_ = RealVect::Map(&loss_mw[0], loss_percent.size());
reset_results();
}

void DCLineContainer::init(const Eigen::VectorXi & branch_from_id,
Expand Down
2 changes: 1 addition & 1 deletion src/element_container/GeneratorContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ GeneratorContainer::StateRes GeneratorContainer::get_state() const

void GeneratorContainer::set_state(GeneratorContainer::StateRes & my_state)
{
reset_results();
names_ = std::get<0>(my_state);
turnedoff_gen_pv_ = std::get<1>(my_state);

Expand Down Expand Up @@ -123,6 +122,7 @@ void GeneratorContainer::set_state(GeneratorContainer::StateRes & my_state)
status_ = status;
gen_slackbus_ = slack_bus;
gen_slack_weight_ = slack_weight;
reset_results();
}

RealVect GeneratorContainer::get_slack_weights(Eigen::Index nb_bus_solver, const std::vector<int> & id_grid_to_solver){
Expand Down

0 comments on commit b808c01

Please sign in to comment.