Esempio n. 1
0
  Param MSSim::getParameters() const
  {
    Param tmp;
    tmp.insert("", this->param_); // get non-labeling options

    vector<String> products = Factory<BaseLabeler>::registeredProducts();

    tmp.setValue("Labeling:type", "labelfree", "Select the labeling type you want for your experiment");
    tmp.setValidStrings("Labeling:type", products);

    for (vector<String>::iterator product_name = products.begin(); product_name != products.end(); ++product_name)
    {
      BaseLabeler* labeler = Factory<BaseLabeler>::create(*product_name);
      if (labeler)
      {
        tmp.insert("Labeling:" + *product_name + ":", labeler->getDefaultParameters());
        if (!tmp.copy("Labeling:" + *product_name).empty())
        {
          // if parameters of labeler are empty, the section will not exist and
          // the command below would fail
          tmp.setSectionDescription("Labeling:" + *product_name, labeler->getDescription());
        }
        delete(labeler);
      }
      else
      {
        throw Exception::InvalidValue(__FILE__, __LINE__, __PRETTY_FUNCTION__, "This labeler returned by the Factory is invalid!", product_name->c_str()); 
      }
    }

    return tmp;
  }