logger_rw.c File Reference

Implementation of the real-world logger. More...

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "coco.h"
#include "coco_internal.h"
#include "coco_utilities.c"
#include "coco_problem.c"
#include "coco_string.c"
#include "observer_rw.c"

Data Structures

struct  logger_rw_data_t
 The rw logger data type. More...
 

Functions

static void logger_rw_evaluate (coco_problem_t *problem, const double *x, double *y)
 Evaluates the function and constraints and outputs the information according to the observer options. More...
 
static void logger_rw_free (void *stuff)
 Frees the memory of the given rw logger. More...
 
static coco_problem_tlogger_rw (coco_observer_t *observer, coco_problem_t *inner_problem)
 Initializes the rw logger. More...
 

Detailed Description

Implementation of the real-world logger.

Can be used to log all (or just those that are better than the preceding) solutions with information about objectives, decision variables (optional) and constraints (optional). See observer_rw() for more information on the options. Produces one "txt" file for each problem function, dimension and instance.

Note
This logger can be used with single- and multi-objective problems, but in the multi-objective case, all solutions are always logged.

Function Documentation

static coco_problem_t* logger_rw ( coco_observer_t observer,
coco_problem_t inner_problem 
)
static

Initializes the rw logger.

Copies all observer field values that are needed after initialization into logger field values for two reasons:

  • If the observer is deleted before the suite, the observer is not available anymore when the logger is finalized.
  • This reduces function calls.
static void logger_rw_evaluate ( coco_problem_t problem,
const double *  x,
double *  y 
)
static

Evaluates the function and constraints and outputs the information according to the observer options.

static void logger_rw_free ( void *  stuff)
static

Frees the memory of the given rw logger.