예제 #1
0
void NumericalIntegration::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
    std::ostringstream buffer;

    file_stream.OpenElement("NumericalIntegration");

    // Numerical integration method

    file_stream.OpenElement("NumericalIntegrationMethod");

    file_stream.PushText(write_numerical_integration_method().c_str());

    file_stream.CloseElement();

    // Display

    file_stream.OpenElement("Display");

    buffer.str("");
    buffer << display;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();


    file_stream.CloseElement();
}
void KappaCoefficientOptimizationThreshold::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
    std::ostringstream buffer;

    //file_stream.OpenElement("KappaCoefficientOptimizationThreshold");

    // Minimum threshold

    file_stream.OpenElement("MinimumThreshold");

    buffer.str("");
    buffer << minimum_threshold;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Maximum threshold

    file_stream.OpenElement("MaximumThreshold");

    buffer.str("");
    buffer << maximum_threshold;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Step

    file_stream.OpenElement("Strep");

    buffer.str("");
    buffer << step;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Reserve function data

    file_stream.OpenElement("ReserveFunctionData");

    buffer.str("");
    buffer << reserve_function_data;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    //file_stream.CloseElement();
}
예제 #3
0
void BoundingLayer::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
   std::ostringstream buffer;

   file_stream.OpenElement("BoundingLayer");

   // Lower bounds

   {
      file_stream.OpenElement("LowerBounds");

      buffer.str("");
      buffer << lower_bounds;

      file_stream.PushText(buffer.str().c_str());

      file_stream.CloseElement();
   }

   // Upper bounds

   {
      file_stream.OpenElement("UpperBounds");

      buffer.str("");
      buffer << upper_bounds;

      file_stream.PushText(buffer.str().c_str());

      file_stream.CloseElement();
   }

   // Display

   {
      file_stream.OpenElement("Display");

      buffer.str("");
      buffer << display;

      file_stream.PushText(buffer.str().c_str());

      file_stream.CloseElement();
   }

   file_stream.CloseElement();
}
예제 #4
0
void NeuralParametersNorm::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
    std::ostringstream buffer;

    //file_stream.OpenElement("NeuralParametersNorm");

    // Neural parameters norm weight

    file_stream.OpenElement("NeuralParametersNormWeight");

    buffer.str("");
    buffer << neural_parameters_norm_weight;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();


    //file_stream.CloseElement();
}
예제 #5
0
void MinkowskiError::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
    std::ostringstream buffer;

    //file_stream.OpenElement("MinkowskiError");

    // Minkowski parameter

    file_stream.OpenElement("MinkowskiParameter");

    buffer.str("");
    buffer << Minkowski_parameter;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();


    //file_stream.CloseElement();
}
void TrainingAlgorithm::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
    std::ostringstream buffer;

    file_stream.OpenElement("TrainingAlgorithm");

    // Display

    file_stream.OpenElement("Display");

    buffer.str("");
    buffer << display;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();


    file_stream.CloseElement();
}
void SimulatedAnnealingOrder::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
    std::ostringstream buffer;

    //file_stream.OpenElement("SimulatedAnnealingOrder");

    // Minimum order

    file_stream.OpenElement("MinimumOrder");

    buffer.str("");
    buffer << minimum_order;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Maximum order

    file_stream.OpenElement("MaximumOrder");

    buffer.str("");
    buffer << maximum_order;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Cooling rate

    file_stream.OpenElement("CoolingRate");

    buffer.str("");
    buffer << cooling_rate;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Trials number

    file_stream.OpenElement("TrialsNumber");

    buffer.str("");
    buffer << trials_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Tolerance

    file_stream.OpenElement("Tolerance");

    buffer.str("");
    buffer << tolerance;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Selection performance goal

    file_stream.OpenElement("SelectionPerformanceGoal");

    buffer.str("");
    buffer << selection_performance_goal;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Minimum temperature

    file_stream.OpenElement("MinimumTemperature");

    buffer.str("");
    buffer << minimum_temperature;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Maximum iterations

    file_stream.OpenElement("MaximumIterationsNumber");

    buffer.str("");
    buffer << maximum_iterations_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Maximum time

    file_stream.OpenElement("MaximumTime");

    buffer.str("");
    buffer << maximum_time;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Reserve performance data

    file_stream.OpenElement("ReservePerformanceHistory");

    buffer.str("");
    buffer << reserve_performance_data;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Reserve selection performance data

    file_stream.OpenElement("ReserveSelectionPerformanceHistory");

    buffer.str("");
    buffer << reserve_selection_performance_data;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();


    //file_stream.CloseElement();
}
void GoldenSectionOrder::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
    std::ostringstream buffer;

    //file_stream.OpenElement("GoldenSectionOrder");

    // Minimum order

    file_stream.OpenElement("MinimumOrder");

    buffer.str("");
    buffer << minimum_order;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Maximum order

    file_stream.OpenElement("MaximumOrder");

    buffer.str("");
    buffer << maximum_order;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Parameters assays number

    file_stream.OpenElement("TrialsNumber");

    buffer.str("");
    buffer << trials_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Performance calculation method

    file_stream.OpenElement("PerformanceCalculationMethod");

    file_stream.PushText(write_loss_calculation_method().c_str());

    file_stream.CloseElement();

    // Reserve parameters data

    file_stream.OpenElement("ReserveParametersData");

    buffer.str("");
    buffer << reserve_parameters_data;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Reserve loss data

    file_stream.OpenElement("ReservePerformanceHistory");

    buffer.str("");
    buffer << reserve_loss_data;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Reserve selection loss data

    file_stream.OpenElement("ReserveSelectionLossHistory");

    buffer.str("");
    buffer << reserve_selection_loss_data;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Reserve minimal parameters

    file_stream.OpenElement("ReserveMinimalParameters");

    buffer.str("");
    buffer << reserve_minimal_parameters;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Display

    file_stream.OpenElement("Display");

    buffer.str("");
    buffer << display;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // selection loss goal

    file_stream.OpenElement("SelectionLossGoal");

    buffer.str("");
    buffer << selection_loss_goal;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Maximum iterations

    file_stream.OpenElement("MaximumIterationsNumber");

    buffer.str("");
    buffer << maximum_iterations_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Maximum time

    file_stream.OpenElement("MaximumTime");

    buffer.str("");
    buffer << maximum_time;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Tolerance

    file_stream.OpenElement("Tolerance");

    buffer.str("");
    buffer << tolerance;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();


    //file_stream.CloseElement();
}
void MissingValues::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
    std::ostringstream buffer;

    const size_t missing_values_number = get_missing_values_number();

    file_stream.OpenElement("MissingValues");

    // Instances number

    file_stream.OpenElement("InstancesNumber");

    buffer.str("");
    buffer << instances_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Variables number

    file_stream.OpenElement("VariablesNumber");

    buffer.str("");
    buffer << variables_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Scrubbing method

    file_stream.OpenElement("ScrubbingMethod");

    file_stream.PushText(write_scrubbing_method().c_str());

    file_stream.CloseElement();

    // Missing values number

    file_stream.OpenElement("MissingValuesNumber");

    buffer.str("");
    buffer << missing_values_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();


    if(missing_values_number <= 0)
    {
        file_stream.CloseElement();

        return;
    }

    std::string instances_indices_text;
    std::string variables_indices_text;

    for(size_t i = 0; i < missing_values_number; i++)
    {
        // Instance index

        const size_t instance_index = items[i].instance_index + 1;

        instances_indices_text.append(number_to_string(instance_index));

        if(i != missing_values_number - 1)
        {
            instances_indices_text.append(" ");
        }


        // Variable index

        const size_t variable_index = items[i].variable_index + 1;

        variables_indices_text.append(number_to_string(variable_index));

        if(i != missing_values_number - 1)
        {
            variables_indices_text.append(" ");
        }
    }

    // Instances indices

    file_stream.OpenElement("InstancesIndices");

    file_stream.PushText(instances_indices_text.c_str());

    file_stream.CloseElement();

    // Variables indices

    file_stream.OpenElement("VariablesIndices");

    file_stream.PushText(variables_indices_text.c_str());

    file_stream.CloseElement();


    file_stream.CloseElement();
}
예제 #10
0
void PlugIn::write_XML(tinyxml2::XMLPrinter& file_stream) const
{
    std::ostringstream buffer;

    file_stream.OpenElement("PlugIn");

    // Independent variables number

    file_stream.OpenElement("IndependentVariablesNumber");

    buffer.str("");
    buffer << independent_variables_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Dependent variables number

    file_stream.OpenElement("DependentVariablesNumber");

    buffer.str("");
    buffer << dependent_variables_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Input method

    file_stream.OpenElement("InputMethod");

    file_stream.PushText(write_input_method().c_str());

    file_stream.CloseElement();

    // Template file_name

    file_stream.OpenElement("TemplateFileName");

    file_stream.PushText(template_file_name.c_str());

    file_stream.CloseElement();

    // Input file_name

    file_stream.OpenElement("InputFileName");

    file_stream.PushText(input_file_name.c_str());

    file_stream.CloseElement();

    // Batch file_name

    file_stream.OpenElement("BatchFileName");

    file_stream.PushText(script_file_name.c_str());

    file_stream.CloseElement();

    // Output file_name

    file_stream.OpenElement("OutputFileName");

    file_stream.PushText(output_file_name.c_str());

    file_stream.CloseElement();

    // Input flags

    file_stream.OpenElement("InputFlags");

    buffer.str("");
    buffer << input_flags;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Output rows number

    file_stream.OpenElement("OutputRowsNumber");

    buffer.str("");
    buffer << output_rows_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Output columns number

    file_stream.OpenElement("OutputColumnsNumber");

    buffer.str("");
    buffer << output_columns_number;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();

    // Display

    file_stream.OpenElement("Display");

    buffer.str("");
    buffer << display;

    file_stream.PushText(buffer.str().c_str());

    file_stream.CloseElement();


    file_stream.CloseElement();
}