Skip to content

Commit

Permalink
update id in growth
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea-Havron-NOAA committed Apr 10, 2024
1 parent c6dfe9f commit 7cb3c58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions inst/include/interface/rcpp/rcpp_objects/rcpp_growth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class GrowthInterfaceBase : public RcppInterfaceBase {

GrowthInterfaceBase() {
this->id = GrowthInterfaceBase::id_g++;
this->module_id = this->id;
GrowthInterfaceBase::growth_objects[this->id] = this;
RcppInterfaceBase::interface_objects.push_back(this);
}
Expand Down Expand Up @@ -178,7 +177,7 @@ class vonBertalanffyInterface : public GrowthInterfaceBase {
void show()const{

Rcout << "vonBertalanffy\n";
Rcout << "id:" << this->module_id << "\n";
Rcout << "id:" << this->id << "\n";
// Rcout << "function value: " << this->objective_function_value << "\n";
//
// Rcout << std::setw(15) << "observed " << std::setw(15) << "predicted\n";
Expand Down
2 changes: 2 additions & 0 deletions inst/include/interface/rcpp/rcpp_objects/rcpp_nll.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ class NormalNLLInterface : public UnivariateNLLInterface{

void SetNLLLinks(std::string nll_type, size_t module_id,
std::string module_name, std::string name){
Rcout << "nll_type: " << nll_type << "modeule_id: " << module_id << "module_name: " << module_name << "name: " << name << std::endl;
this->nll_type = nll_type;

std::stringstream ss;
ss << module_name << "_" << module_id << "_" << name;

this->key = ss.str();
Rcout << "key: " << this->key << std::endl;
ss.str("");
}
/*
Expand Down
1 change: 1 addition & 0 deletions test/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ DataNLL$expected_value <- rep(0, length(length.data))
DataNLL$log_sd <- 0
DataNLL$nll_type = "data"
DataNLL$estimate_log_sd <- TRUE
c("data", Pop$get_id( ), Pop$get_module_name(), "length")
DataNLL$set_nll_links( "data", Pop$get_id(), Pop$get_module_name(), "length")


Expand Down

0 comments on commit 7cb3c58

Please sign in to comment.