** jobnames;
86 const char** resourcenames;
113 for(i = 0; i < rcpspdata->njobs ; ++i )
119 for(
r= 0;
r< rcpspdata->nresources; ++
r)
130 for(
r= 0;
r< rcpspdata->nresources; ++
r)
155 const char* erritem,
159assert(msg !=
NULL);
160assert(state !=
NULL);
162 if( erritem !=
NULL)
181assert(linestr !=
NULL);
182assert(state !=
NULL);
184 if( strncmp(linestr,
"jobs", 4) == 0 )
186 else if( strncmp(linestr,
"RESOURCES", 9) == 0 )
188 else if( strncmp(linestr,
"PRECEDENCE", 4) == 0 )
190 else if( strncmp(linestr,
"REQUESTS", 4) == 0 )
192 else if( strncmp(linestr,
"RESOURCEAVAILABILITIES", 10) == 0 )
210assert(linestr !=
NULL);
211assert(state !=
NULL);
213 if( strncmp(linestr,
"RESOURCES", 4) == 0 )
222 parseError(
scip, lineno,
"expexted number of resources", linestr, state);
226rcpspdata->nresources = (int)(nresources + 0.5);
250assert(linestr !=
NULL);
251assert(state !=
NULL);
259 parseError(
scip, lineno,
"expexted number of jobs", linestr, state);
263rcpspdata->njobs = (int)(njobs + 0.5);
287assert(linestr !=
NULL);
288assert(state !=
NULL);
290 if( strncmp(linestr,
"RESOURCEAVAILABILITIES", 10) == 0 )
299 while(isspace(*name))
324assert(linestr !=
NULL);
325assert(state !=
NULL);
328 for(
r= 0;
r< rcpspdata->nresources; ++
r)
331rcpspdata->capacities[
r] = (int)(value + 0.5);
353assert(linestr !=
NULL);
354assert(state !=
NULL);
357 if( (!strncmp(linestr,
"REQUESTS", 4) ) || ( !strncmp(linestr,
"jobnr", 3) ) || ( !strncmp(linestr,
"-", 1) ) )
383rcpspdata->durations[jobid] = value;
388 for(
r= 0;
r< rcpspdata->nresources; ++
r)
393rcpspdata->demands[jobid][
r] = value;
397 if( jobid == rcpspdata->njobs - 1 )
418assert(state !=
NULL);
420 if( ( !strncmp(s,
"PRECEDENCES", 3) ) || ( !strncmp(s,
"jobnr", 4) ) )
427 if( rcpspdata->precedencegraph ==
NULL)
447 for( p = 0; p < nsuccessors; ++p )
460 if(pred == rcpspdata->njobs-1)
479 for( j = 0; j < njobs; ++j )
489duration = durations[j];
491 for( i = 0; i < nsuccessors; ++i )
495distance = (int)(
size_t)distances[i];
497 if( distance != INT_MAX )
498duration =
MAX(duration, distance);
511 const char* filename,
521assert(filename !=
NULL);
535 if(
NULL!= (s = strpbrk(buf,
"*\r\n")) )
602 if( state !=
END&& state !=
ERROR)
605 if( state ==
ERROR)
620assert(reader !=
NULL);
638rcpspdata.precedencegraph =
NULL;
639rcpspdata.jobnames =
NULL;
640rcpspdata.durations =
NULL;
641rcpspdata.demands =
NULL;
642rcpspdata.capacities =
NULL;
644rcpspdata.nresources = 0;
654 if( strncmp(predfilename,
"-", 1) != 0 )
658file = fopen(predfilename,
"w");
674rcpspdata.precedencegraph, rcpspdata.durations, rcpspdata.capacities, rcpspdata.njobs, rcpspdata.nresources,
TRUE) );
679 if( rcpspdata.njobs > 0 )
681 for( j = 0; j < rcpspdata.njobs; ++j )
692 if( rcpspdata.nresources > 0 )
696 for(
r= 0;
r< rcpspdata.nresources; ++
r)
703 if( rcpspdata.precedencegraph !=
NULL)
728assert(reader !=
NULL);
735 "reading/"READER_NAME"/mipmodel",
"create MIP model?",
740 "file name of precedence graph output file (in GML format), or - if no output should be created",
749 const char* problemname,
750 const char** jobnames,
751 const char** resourcenames,
779assert( njobs >= 0 );
793 for( j = 0; j < njobs - 1; ++j )
796 if( jobnames !=
NULL)
822 for( j = 0; j < njobs - 1; ++j )
830assert(predvar !=
NULL);
832 if( nsuccessors > 0 )
840 for( i = 0; i < nsuccessors; ++i )
845succvar = jobs[successors[i]];
846assert(succvar !=
NULL);
850distance = (int)(
size_t)distances[i];
852 if( distance == INT_MAX )
853distance = durations[j];
880 for(
r= 0;
r< nresources; ++
r)
883 for( j = 0; j < njobs; ++j )
885 if( demands[j][
r] > 0 )
887vars[nvars] = jobs[j];
888consdemands[nvars] = demands[j][
r];
889consdurations[nvars] = durations[j];
897 if( resourcenames !=
NULL)
903nvars, vars, consdurations, consdemands, capacities[
r],
914durations, demands, capacities, njobs, nresources) );
constraint handler for cumulative constraints
Constraint handler for linear constraints in their most general form, .
Constraint handler for variable bound constraints .
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfclose(SCIP_FILE *fp)
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
SCIP_RETCODE SCIPcreateConsVarbound(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, SCIP_Real vbdcoef, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPcreateConsCumulative(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
void ** SCIPdigraphGetSuccessorsData(SCIP_DIGRAPH *digraph, int node)
int SCIPdigraphGetNSuccessors(SCIP_DIGRAPH *digraph, int node)
void SCIPdigraphPrintGml(SCIP_DIGRAPH *digraph, FILE *file)
SCIP_RETCODE SCIPdigraphAddArc(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
void SCIPdigraphFree(SCIP_DIGRAPH **digraph)
void SCIPdigraphPrint(SCIP_DIGRAPH *digraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
int * SCIPdigraphGetSuccessors(SCIP_DIGRAPH *digraph, int node)
SCIP_RETCODE SCIPcreateDigraph(SCIP *scip, SCIP_DIGRAPH **digraph, int nnodes)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateProb(SCIP *scip, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
const char * SCIPreaderGetName(SCIP_READER *reader)
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPstrToIntValue(const char *str, int *value, char **endptr)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
void SCIPprintSysError(const char *message)
char * SCIPstrtok(char *s, const char *delim, char **ptrptr)
SCIP_RETCODE SCIPinitializeHeurListScheduling(SCIP *scip, SCIP_DIGRAPH *precedencegraph, SCIP_VAR **vars, int *durations, int **resourcedemands, int *capacities, int njobs, int nresources)
scheduling specific primal heuristic which is based on bidirectional serial generation scheme.
struct SCIP_File SCIP_FILE
static void checkForNewSection(char *linestr, STATE *state)
static void parseError(SCIP *scip, int lineno, const char *msg, const char *erritem, STATE *state)
SCIP_RETCODE SCIPcreateSchedulingProblem(SCIP *scip, const char *problemname, const char **jobnames, const char **resourcenames, int **demands, SCIP_DIGRAPH *precedencegraph, int *durations, int *capacities, int njobs, int nresources, SCIP_Bool initialize)
SCIP_RETCODE SCIPincludeReaderSm(SCIP *scip)
static int computeUbmakespan(int *durations, int njobs, SCIP_DIGRAPH *precedencegraph)
struct SCIP_RcpspData SCIP_RCPSPDATA
static SCIP_RETCODE getResourcesNames(SCIP *scip, char *linestr, STATE *state, SCIP_RCPSPDATA *rcpspdata)
static SCIP_RETCODE getNJobs(SCIP *scip, int lineno, char *linestr, STATE *state, SCIP_RCPSPDATA *rcpspdata)
static SCIP_RETCODE getNResources(SCIP *scip, int lineno, char *linestr, STATE *state, SCIP_RCPSPDATA *rcpspdata)
static SCIP_RETCODE getPrecedence(SCIP *scip, char *s, STATE *state, SCIP_RCPSPDATA *rcpspdata)
static SCIP_RETCODE readFile(SCIP *scip, const char *filename, SCIP_RCPSPDATA *rcpspdata)
static SCIP_RETCODE getResourcesCapacities(SCIP *scip, char *linestr, STATE *state, SCIP_RCPSPDATA *rcpspdata)
static SCIP_DECL_READERREAD(readerReadSm)
enum reading_states STATE
static SCIP_RETCODE getJobs(SCIP *scip, char *linestr, STATE *state, SCIP_RCPSPDATA *rcpspdata)
static SCIP_DECL_READERCOPY(readerCopySm)
scheduling problem file reader for RCPSP format
struct SCIP_ReaderData SCIP_READERDATA
enum SCIP_Retcode SCIP_RETCODE
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4