Solving Constraint Integer Programs

reader_sch.c File Reference

Detailed Description

scheduling problem file reader for RCPSP/max format

Stefan Heinz

This reader is capabale of parsing resource-constrained project scheduling problem with minimal and maximal time lags (RCPSP/max) instances. The <a">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.


#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


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


#define READER_NAME   "schreader"

Definition at line 38 of file reader_sch.c.

Referenced by SCIP_DECL_READERCOPY(), and SCIPincludeReaderSch().


#define READER_DESC   "scheduling file reader for sch files (RCPSP/max format)"

Definition at line 39 of file reader_sch.c.

Referenced by SCIPincludeReaderSch().


#define READER_EXTENSION   "sch"

Definition at line 40 of file reader_sch.c.

Referenced by SCIPincludeReaderSch().


#define SCH_MAX_LINELEN   65536

size of the line buffer for reading or writing

Definition at line 43 of file reader_sch.c.

Referenced by parseDetails(), and readFile().

Function Documentation

◆ addLowerboundCons()

static SCIP_RETCODE addLowerboundCons ( SCIP scip)

◆ getJobId()

static SCIP_RETCODE getJobId ( SCIP scip,
const char *  str,
int *  job,
char **  endptr 

parse job id and check if only one job mode is present

scipSCIP data structure
strstring to search
jobpointer to store the parsed job id
endptrpointer to store the final string position if successfully parsed

Definition at line 90 of file reader_sch.c.

References SCIP_OKAY, SCIP_READERROR, SCIPstrToIntValue(), and SCIPwarningMessage().

Referenced by parseDetails().

◆ parseDetails()

static SCIP_RETCODE parseDetails ( SCIP scip,
int *  lineno,
int **  demands,
SCIP_DIGRAPH precedencegraph,
int *  durations,
int *  capacities,
int  njobs,
int  nresources 

parse job and capacities details

scipSCIP data structure
filefile to parse
linenopointer to store line number of the file
demandsdemand matrix resource job demand
precedencegraphdirect graph to store the precedence conditions
durationsarray to store the processing for each job
capacitiesarray to store the different capacities
njobsnumber of jobs to be parsed
nresourcesnumber of capacities to be parsed

Definition at line 118 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(), SCIPstrToIntValue(), and CminInput::token.

Referenced by readFile().

◆ readFile()

static SCIP_RETCODE readFile ( SCIP scip,
const char *  filename 

read file and create problem

scipSCIP data structure
filefile to pares
filenamename of input file

Definition at line 254 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().



static SCIP_DECL_READERCOPY ( readerCopySch  )

copy method for reader plugins (called when SCIP copies plugins)

Definition at line 347 of file reader_sch.c.

References NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderSch(), and SCIPreaderGetName().


static SCIP_DECL_READERREAD ( readerReadSch  )

problem reading method of reader

Definition at line 361 of file reader_sch.c.

References CminInput::file, 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

scipSCIP data structure

Definition at line 400 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().