/**
 * Validate the parameters passed in from the
 * configuration file
 */
void Observation::Validate() {
  LOG_TRACE();
  parameters_.Populate(model_);
  LOG_FINEST() << "validating obs " << label_ << " of type = " << type_;

  if (model_->run_mode() == RunMode::kSimulation) {
    if (likelihood_type_ == PARAM_PSEUDO) {
      likelihood_type_ = simulation_likelihood_label_;
    } else {
      simulation_likelihood_label_ = likelihood_type_;
    }
  }

  /**
   * Because this observation supports categories that are provided in groups
   * (using the + operator) we need to verify the number of selectivities
   * matches the true number of categories
   *
   * The number of selectivities can be either the number of true categories
   * or the number of defined collections
   */
  expected_selectivity_count_ = 0;
  Categories* categories = model_->categories();
  for (const string& category_label : category_labels_)
    expected_selectivity_count_ += categories->GetNumberOfCategoriesDefined(category_label);

  LOG_FINEST() << "Expected Selectivity count = " << expected_selectivity_count_;
  DoValidate();
}
Exemple #2
0
void gxViewElement::Validate()
{
    // Keep whether I was invalid before validating the children.
    bool iWasInvalid = IsInvalid();
    
    // Mark me as valid - notice the comment below. If MarkValid() would come
    // after the validation of the descendants, it would override them possibly
    // setting this view element to invalid.
    MarkValid();
    
    
    Iterator iChildren( GetChildren() );
    
    // Ask all children to validate themselves in case they are invalid.
    // Notice that validate on descendants may trigger invalidation and will
    // mark this view element as invalid again.
    for ( iChildren.First(); iChildren.Current(); iChildren.Next() )
    {
        if ( iChildren.Current()->IsntValid() )
            iChildren.Current()->Validate();
    }

    // If I was invalid before validating the descendants, and if I'm not
    // invalid now (because my descendants have marked me as such) - validate
    // me and perform the layout. (If I am invalid now, then the next validation
    // event will lead to my validation.
    if ( iWasInvalid && IsntInvalid() )
    {
        DoValidate();
        Layout();
    }
}
Exemple #3
0
void Selectivity::Validate() {
  parameters_.Populate();
  DoValidate();

  if (length_based_) {
    boost::math::normal dist{ };

    for (unsigned i = 1; i <= n_quant_; ++i) {
      quantiles_.push_back((Double(i) - 0.5) / Double(n_quant_));
      LOG_FINEST() << ": Quantile value = " << quantiles_[i - 1];
      quantiles_at_.push_back(quantile(dist, AS_DOUBLE(quantiles_[i - 1])));
      LOG_FINEST() << ": Normal quantile value = " << quantiles_at_[i - 1];
    }
  }
}
Exemple #4
0
/**
 * Call the validation method for the child object of this process and
 * set some generic variables.
 */
void Process::Validate() {
  parameters_.Populate();

  if (block_type_ != PARAM_PROCESS && block_type_ != PARAM_PROCESSES) {
    if (type_ != "")
      type_ = block_type_ + "_" + type_;
    else
      type_ = block_type_;

    block_type_ = PARAM_PROCESS;
  }

  if (process_type_ == ProcessType::kUnknown)
    LOG_CODE_ERROR() << "process_type_ == ProcessType::kUnknown for label: " << label();

  DoValidate();
}
Exemple #5
0
/**
 * Validate our penalty parameters
 */
void Penalty::Validate() {
  parameters_.Populate();
  DoValidate();
}
Exemple #6
0
/**
 * Populate any parameters,
 * Validate values are within expected ranges when we cannot use bind<>() overloads
 *
 * Note: all parameters are populated from configuration files
 */
void AgeLength::Validate() {
  parameters_.Populate();

  DoValidate();
}
void Project::Validate() {
  parameters_.Populate(model_);
  DoValidate();
}
Exemple #8
0
/**
 * Populate any parameters,
 * Validate values are within expected ranges when we cannot use bind<>() overloads
 *
 * Note: all parameters are populated from configuration files
 */
void Assert::Validate() {
  parameters_.Populate();
  DoValidate();
}
Exemple #9
0
/**
 * Validate our estimate. Some of the
 * validation was done by the
 * estimates::Info object before the
 * estimate was created so we can skip that.
 */
void Estimate::Validate() {
  DoValidate();
}