Detailed Description
SCFLP reader file reader.
This file implements the reader/parser used to read the CAP input data and builds a SCFLP instance. For more details see Parsing the input format.
Definition in file reader_scflp.c.
#include <assert.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include "probdata_scflp.h"
#include "reader_scflp.h"
Go to the source code of this file.
Macros | |
Reader properties | |
#define | READER_NAME "scflpreader" |
#define | READER_DESC "file reader for CAP data format and creates a SCFLP instance" |
#define | READER_EXTENSION "cap" |
#define | DEFAULT_USEBENDERS FALSE |
#define | DEFAULT_NUMSCENARIOS 250 |
#define | DEFAULT_RANDOMSEED 1 |
#define | MAXNCOSTS 7 |
Functions | |
static SCIP_Real | generateGaussianNoise (SCIP_RANDNUMGEN *randomgen, SCIP_Real mean, SCIP_Real stdDev, SCIP_Real *spare, SCIP_Bool *hasspare) |
static SCIP_RETCODE | readerdataCreate (SCIP *scip, SCIP_READERDATA **readerdata) |
static SCIP_RETCODE | readerdataFree (SCIP *scip, SCIP_READERDATA **readerdata) |
Callback methods | |
static | SCIP_DECL_READERFREE (readerFreeScflp) |
static | SCIP_DECL_READERREAD (readerReadScflp) |
Interface methods | |
SCIP_RETCODE | SCIPincludeReaderScflp (SCIP *scip) |
Macro Definition Documentation
◆ READER_NAME
#define READER_NAME "scflpreader" |
Definition at line 100 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ READER_DESC
#define READER_DESC "file reader for CAP data format and creates a SCFLP instance" |
Definition at line 101 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ READER_EXTENSION
#define READER_EXTENSION "cap" |
Definition at line 102 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ DEFAULT_USEBENDERS
#define DEFAULT_USEBENDERS FALSE |
Definition at line 105 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ DEFAULT_NUMSCENARIOS
#define DEFAULT_NUMSCENARIOS 250 |
Definition at line 106 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ DEFAULT_RANDOMSEED
#define DEFAULT_RANDOMSEED 1 |
Definition at line 107 of file reader_scflp.c.
Referenced by SCIPincludeReaderScflp().
◆ MAXNCOSTS
#define MAXNCOSTS 7 |
Definition at line 109 of file reader_scflp.c.
Referenced by SCIP_DECL_READERREAD().
Function Documentation
◆ generateGaussianNoise()
|
static |
generates a normally distributed random number
- Parameters
-
randomgen the random number generator mean the mean of the normal distribution stdDev the standard deviation of the normal distribution spare the spare value that has been collected hasspare whether a spare value exists
Definition at line 122 of file reader_scflp.c.
References FALSE, log(), SCIP_Real, SCIPrandomGetReal(), sqrt(), and TRUE.
Referenced by SCIP_DECL_READERREAD().
◆ readerdataCreate()
|
static |
creates the reader data
- Parameters
-
scip SCIP data structure readerdata pointer to store the reader data
Definition at line 158 of file reader_scflp.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, and TRUE.
Referenced by SCIPincludeReaderScflp().
◆ readerdataFree()
|
static |
frees the reader data
- Parameters
-
scip SCIP data structure readerdata pointer to store the reader data
Definition at line 174 of file reader_scflp.c.
References NULL, SCIP_OKAY, and SCIPfreeBlockMemory.
Referenced by SCIP_DECL_READERFREE().
◆ SCIP_DECL_READERFREE()
|
static |
destructor of reader to free user data (called when SCIP is exiting)
Definition at line 196 of file reader_scflp.c.
References NULL, readerdataFree(), SCIP_CALL, SCIP_OKAY, and SCIPreaderGetData().
◆ SCIP_DECL_READERREAD()
|
static |
problem reading method of reader
Definition at line 213 of file reader_scflp.c.
References FALSE, generateGaussianNoise(), MAXNCOSTS, NULL, SCIP_Bool, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_MAXSTRLEN, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIP_SUCCESS, SCIPallocBufferArray, SCIPceil(), SCIPcreateRandom(), SCIPdebugMsg, SCIPerrorMessage, SCIPfclose(), SCIPfeof(), SCIPfgets(), SCIPfopen(), SCIPfreeBufferArray, SCIPfreeRandom(), SCIPprintSysError(), SCIPprobdataCreate(), SCIPrandomGetReal(), SCIPreaderGetData(), SCIPround(), SCIPwarningMessage(), and TRUE.
◆ SCIPincludeReaderScflp()
SCIP_RETCODE SCIPincludeReaderScflp | ( | SCIP * | scip | ) |
includes the scflp file reader in SCIP
- Parameters
-
scip SCIP data structure
Definition at line 463 of file reader_scflp.c.
References DEFAULT_NUMSCENARIOS, DEFAULT_RANDOMSEED, DEFAULT_USEBENDERS, FALSE, NULL, READER_DESC, READER_EXTENSION, READER_NAME, readerdataCreate(), SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPaddIntParam(), SCIPincludeReaderBasic(), SCIPsetReaderFree(), and SCIPsetReaderRead().
Referenced by runShell().