Scippy

SCIP

Solving Constraint Integer Programs

reader_sch.c File Reference

Detailed Description

scheduling problem file reader for RCPSP/max format

Author
Stefan Heinz

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.

Referenced by SCIP_DECL_READERCOPY(), and SCIPincludeReaderSch().

◆ READER_DESC

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

Definition at line 48 of file reader_sch.c.

Referenced by SCIPincludeReaderSch().

◆ READER_EXTENSION

#define READER_EXTENSION   "sch"

Definition at line 49 of file reader_sch.c.

Referenced by SCIPincludeReaderSch().

◆ 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.

Referenced by parseDetails(), and readFile().

Function Documentation

◆ addLowerboundCons()

static SCIP_RETCODE addLowerboundCons ( SCIP scip)
static

◆ getJobId()

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

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

Parameters
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 99 of file reader_sch.c.

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

Referenced by parseDetails().

◆ parseDetails()

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

parse job and capacities details

Parameters
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 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(), SCIPstrToIntValue(), and CminInput::token.

Referenced by readFile().

◆ readFile()

static SCIP_RETCODE readFile ( SCIP scip,
SCIP_FILE file,
const char *  filename 
)
static

read file and create problem

Parameters
scipSCIP data structure
filefile to pares
filenamename 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 SCIP_DECL_READERCOPY ( readerCopySch  )
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 SCIP_DECL_READERREAD ( readerReadSch  )
static

problem reading method of reader

Definition at line 370 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

Parameters
scipSCIP 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().