Scippy

SCIP

Solving Constraint Integer Programs

main.cpp
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file Scheduler/src/main.cpp
17  * @brief Main file for C++ compilation
18  * @author Stefan Heinz
19  */
20 
21 /*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 
24 #include "scip/scip.h"
25 #include "scip/scipdefplugins.h"
26 #include "scip/scipshell.h"
27 
28 #include "cons_optcumulative.h"
29 #include "heur_optcumulative.h"
30 #include "heur_listscheduling.h"
31 #include "reader_cmin.h"
32 #include "reader_sch.h"
33 #include "reader_sm.h"
34 #include "reader_rcp.h"
35 
36 /** runs the shell */
37 static
39  int argc, /**< number of shell parameters */
40  char** argv, /**< array with shell parameters */
41  const char* defaultsetname /**< name of default settings file */
42  )
43 {
44  SCIP* scip = NULL;
45 
46  /*********
47  * Setup *
48  *********/
49 
50  /* initialize SCIP */
51  SCIP_CALL( SCIPcreate(&scip) );
52 
53  /* we explicitly enable the use of a debug solution for this main SCIP instance */
54  SCIPenableDebugSol(scip);
55 
56  /* include default plugins */
58 
59  /* include problem reader */
64 
65  /* include problem specific heuristic */
68 
69  /* include cumulative constraint handler with optional activities */
71 
72 #ifdef WITH_CPOPTIMIZER
73  SCIP_CALL( SCIPsetSolveCumulative(scip, cpoptimizer) );
74 #endif
75 
76  /**********************************
77  * Process command line arguments *
78  **********************************/
79 
80  SCIP_CALL( SCIPprocessShellArguments(scip, argc, argv, defaultsetname) );
81 
82  /********************
83  * Deinitialization *
84  ********************/
85 
86  SCIP_CALL( SCIPfree(&scip) );
87 
88  /* check block memory */
90 
91  return SCIP_OKAY;
92 }
93 
94 /** main method */
95 int main(
96  int argc, /**< number of arguments */
97  char** argv /**< string array with arguments */
98  )
99 {
100  SCIP_RETCODE retcode;
101 
102  retcode = runShell(argc, argv, "scip.set");
103 
104  if( retcode != SCIP_OKAY )
105  {
106  SCIPprintError(retcode);
107  return -1;
108  }
109 
110  return 0;
111 }
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip_general.c:211
#define BMScheckEmptyMemory()
Definition: memory.h:147
cmin file reader
SCIP_RETCODE SCIPincludeReaderCmin(SCIP *scip)
Definition: reader_cmin.c:1372
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
int main(int argc, char **argv)
Definition: main.cpp:38
SCIP_RETCODE SCIPincludeHeurOptcumulative(SCIP *scip)
SCIP_RETCODE SCIPincludeHeurListScheduling(SCIP *scip)
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:283
file reader for "pack" scheduling instances
SCIP_RETCODE SCIPincludeReaderSch(SCIP *scip)
Definition: reader_sch.c:400
SCIP_RETCODE SCIPincludeConshdlrOptcumulative(SCIP *scip)
SCIP command line interface.
void SCIPenableDebugSol(SCIP *scip)
Definition: scip_debug.c:48
SCIP_RETCODE SCIPincludeReaderSm(SCIP *scip)
Definition: reader_sm.c:707
#define NULL
Definition: lpi_spx1.cpp:155
SCIP_RETCODE SCIPincludeReaderRcp(SCIP *scip)
Definition: reader_rcp.c:300
#define SCIP_CALL(x)
Definition: def.h:364
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:148
heuristic for cumulative scheduling with optional activities
scheduling problem file reader for RCPSP format
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition: main.cpp:38
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:315
default SCIP plugins
constraint handler for cumulative constraints with optional activities
scheduling problem file reader for RCPSP/max format
SCIP callable library.
SCIP_RETCODE SCIPsetSolveCumulative(SCIP *scip, SCIP_DECL_SOLVECUMULATIVE((*solveCumulative)))
scheduling specific primal heuristic which is based on bidirectional serial generation scheme...