Detailed Description
scheduling problem file reader for RCPSP/max format
This reader is capabale of parsing resource-constrained project scheduling problem with minimal and maximal time lags (RCPSP/max) instances. The <a http://www.wior.uni-karlsruhe.de/LS_Neumann/Forschung/ProGenMax/rcpspmax.html">PSPlib provides several instances set.
Definition in file reader_sch.c.
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include "reader_sch.h"
#include "reader_sm.h"
#include "scip/cons_bounddisjunction.h"
Go to the source code of this file.
Macros | |
#define | READER_NAME "schreader" |
#define | READER_DESC "scheduling file reader for sch files (RCPSP/max format)" |
#define | READER_EXTENSION "sch" |
#define | SCH_MAX_LINELEN 65536 |
Functions | |
static SCIP_RETCODE | addLowerboundCons (SCIP *scip) |
static SCIP_RETCODE | getJobId (SCIP *scip, const char *str, int *job, char **endptr) |
static SCIP_RETCODE | parseDetails (SCIP *scip, SCIP_FILE *file, int *lineno, int **demands, SCIP_DIGRAPH *precedencegraph, int *durations, int *capacities, int njobs, int nresources) |
static SCIP_RETCODE | readFile (SCIP *scip, SCIP_FILE *file, const char *filename) |
static | SCIP_DECL_READERCOPY (readerCopySch) |
static | SCIP_DECL_READERREAD (readerReadSch) |
SCIP_RETCODE | SCIPincludeReaderSch (SCIP *scip) |
Macro Definition Documentation
◆ READER_NAME
#define READER_NAME "schreader" |
Definition at line 47 of file reader_sch.c.
◆ READER_DESC
#define READER_DESC "scheduling file reader for sch files (RCPSP/max format)" |
Definition at line 48 of file reader_sch.c.
◆ READER_EXTENSION
#define READER_EXTENSION "sch" |
Definition at line 49 of file reader_sch.c.
◆ SCH_MAX_LINELEN
#define SCH_MAX_LINELEN 65536 |
size of the line buffer for reading or writing
Definition at line 52 of file reader_sch.c.
Function Documentation
◆ addLowerboundCons()
|
static |
- Parameters
-
scip SCIP data structure
Definition at line 59 of file reader_sch.c.
References FALSE, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddCons(), SCIPallocBufferArray, SCIPcreateConsBounddisjunction(), SCIPfreeBufferArray, SCIPgetNVars(), SCIPgetVars(), SCIPreleaseCons(), SCIPvarGetLbGlobal(), and TRUE.
Referenced by readFile().
◆ getJobId()
|
static |
parse job id and check if only one job mode is present
- Parameters
-
scip SCIP data structure str string to search job pointer to store the parsed job id endptr pointer to store the final string position if successfully parsed
Definition at line 99 of file reader_sch.c.
References SCIP_OKAY, SCIP_READERROR, SCIPstrToIntValue(), and SCIPwarningMessage().
Referenced by parseDetails().
◆ parseDetails()
|
static |
parse job and capacities details
- Parameters
-
scip SCIP data structure file file to parse lineno pointer to store line number of the file demands demand matrix resource job demand precedencegraph direct graph to store the precedence conditions durations array to store the processing for each job capacities array to store the different capacities njobs number of jobs to be parsed nresources number of capacities to be parsed
Definition at line 127 of file reader_sch.c.
References getJobId(), NULL, r, SCH_MAX_LINELEN, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_READERROR, SCIPallocBufferArray, SCIPdebugMessage, SCIPdebugPrintf, SCIPdigraphAddArc(), SCIPfgets(), SCIPfreeBufferArray, SCIPstrCopySection(), and SCIPstrToIntValue().
Referenced by readFile().
◆ readFile()
|
static |
read file and create problem
- Parameters
-
scip SCIP data structure file file to pares filename name of input file
Definition at line 263 of file reader_sch.c.
References addLowerboundCons(), BMSclearMemoryArray, FALSE, NULL, parseDetails(), SCH_MAX_LINELEN, SCIP_CALL, SCIP_OKAY, SCIP_READERROR, SCIPallocBufferArray, SCIPcreateDigraph(), SCIPcreateSchedulingProblem(), SCIPdebugMessage, SCIPdigraphFree(), SCIPfgets(), SCIPfreeBufferArray, and SCIPstrToIntValue().
Referenced by SCIP_DECL_READERREAD().
◆ SCIP_DECL_READERCOPY()
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 356 of file reader_sch.c.
References NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderSch(), and SCIPreaderGetName().
◆ SCIP_DECL_READERREAD()
|
static |
problem reading method of reader
Definition at line 370 of file reader_sch.c.
References NULL, readFile(), SCIP_CALL, SCIP_NOFILE, SCIP_OKAY, SCIP_SUCCESS, SCIPerrorMessage, SCIPfclose(), SCIPfopen(), and SCIPprintSysError().
◆ SCIPincludeReaderSch()
SCIP_RETCODE SCIPincludeReaderSch | ( | SCIP * | scip | ) |
includes the sch file reader in SCIP
- Parameters
-
scip SCIP data structure
Definition at line 409 of file reader_sch.c.
References FALSE, NULL, READER_DESC, READER_EXTENSION, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPincludeReaderBasic(), SCIPsetReaderCopy(), and SCIPsetReaderRead().
Referenced by runShell(), and SCIP_DECL_READERCOPY().