STO file reader - the stochastic information of an instance in SMPS format.
Definition in file reader_sto.c.
#include "blockmemshell/memory.h"#include "scip/benders_default.h"#include "scip/cons_linear.h"#include "scip/pub_cons.h"#include "scip/pub_fileio.h"#include "scip/pub_message.h"#include "scip/pub_misc.h"#include "scip/pub_reader.h"#include "scip/pub_var.h"#include "scip/reader_cor.h"#include "scip/reader_sto.h"#include "scip/reader_tim.h"#include "scip/scip_cons.h"#include "scip/scip_debug.h"#include "scip/scipdefplugins.h"#include "scip/scip_general.h"#include "scip/scip_mem.h"#include "scip/scip_message.h"#include "scip/scip_numerics.h"#include "scip/scip_param.h"#include "scip/scip_prob.h"#include "scip/scip_reader.h"#include "scip/scip_var.h"#include <stdlib.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | StoScenario |
| struct | StoInput |
Macros | |
| #define | READER_NAME "storeader" |
| #define | READER_DESC "file reader for stochastic information of stochastic programs in the SMPS file format" |
| #define | READER_EXTENSION "sto" |
| #define | DEFAULT_USEBENDERS FALSE |
| #define | STO_MAX_LINELEN 1024 |
| #define | STO_MAX_NAMELEN 256 |
| #define | STO_DEFAULT_ARRAYSIZE 100 |
| #define | STO_DEFAULT_ENTRIESSIZE 20 |
| #define | STO_DEFAULT_BLOCKARRAYSIZE 5 |
| #define | STO_DEFAULT_CHILDRENSIZE 5 |
| #define | BLANK ' ' |
| #define READER_NAME "storeader" |
Definition at line 60 of file reader_sto.c.
| #define READER_DESC "file reader for stochastic information of stochastic programs in the SMPS file format" |
Definition at line 61 of file reader_sto.c.
| #define READER_EXTENSION "sto" |
Definition at line 62 of file reader_sto.c.
| #define DEFAULT_USEBENDERS FALSE |
should Benders' decomposition be used for the stochastic program?
Definition at line 64 of file reader_sto.c.
Referenced by SCIPincludeReaderScflp(), and SCIPincludeReaderSto().
| #define STO_MAX_LINELEN 1024 |
Definition at line 70 of file reader_sto.c.
Referenced by stoinputReadLine().
| #define STO_MAX_NAMELEN 256 |
Definition at line 71 of file reader_sto.c.
Referenced by stoinputSetProbname(), and stoinputSetStochtype().
| #define STO_DEFAULT_ARRAYSIZE 100 |
Definition at line 73 of file reader_sto.c.
Referenced by readBlocks(), and readIndep().
| #define STO_DEFAULT_ENTRIESSIZE 20 |
Definition at line 74 of file reader_sto.c.
Referenced by createScenarioData().
| #define STO_DEFAULT_BLOCKARRAYSIZE 5 |
Definition at line 75 of file reader_sto.c.
Referenced by createScenariosFromBlocks(), readBlocks(), and readIndep().
| #define STO_DEFAULT_CHILDRENSIZE 5 |
Definition at line 76 of file reader_sto.c.
Referenced by createScenarioData().
| #define BLANK ' ' |
Definition at line 78 of file reader_sto.c.
| typedef struct StoScenario STOSCENARIO |
Definition at line 80 of file reader_sto.c.
| typedef enum StoSection STOSECTION |
Definition at line 126 of file reader_sto.c.
| typedef enum StoStochInfo STOSTOCHINFO |
Definition at line 138 of file reader_sto.c.
Definition at line 159 of file reader_sto.c.
| enum StoSection |
enum containing all sto sections
| Enumerator | |
|---|---|
| STO_STOCH | |
| STO_SCENARIOS | |
| STO_BLOCKS | |
| STO_INDEP | |
| STO_ENDATA | |
Definition at line 118 of file reader_sto.c.
| enum StoStochInfo |
enum containing the types of stochastic information
| Enumerator | |
|---|---|
| STO_STOCHINFO_NONE | |
| STO_STOCHINFO_DISCRETE | |
| STO_STOCHINFO_UNIFORM | |
| STO_STOCHINFO_NORMAL | |
| STO_STOCHINFO_SUB | |
| STO_STOCHINFO_LINTR | |
Definition at line 129 of file reader_sto.c.
|
static |
creates a scenario structure
Definition at line 163 of file reader_sto.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, SCIPdebugMessage, SCIPinfinity(), STO_DEFAULT_CHILDRENSIZE, and STO_DEFAULT_ENTRIESSIZE.
Referenced by buildScenariosFromBlocks(), createReaderdata(), readBlocks(), readIndep(), readScenarios(), and scenarioAddChild().
|
static |
frees the memory used for the scenario tree
Definition at line 199 of file reader_sto.c.
References assert(), freeScenarioTree(), i, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPfree(), SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArray.
Referenced by createScenariosFromBlocks(), freeReaderdata(), freeScenarioTree(), readBlocks(), readIndep(), and readScenarios().
|
static |
sets the SCIP pointer to the scenario
Definition at line 252 of file reader_sto.c.
References assert(), NULL, and StoScenario::scip.
Referenced by addScenarioVarsAndConsToProb(), and buildDecompProblem().
|
static |
returns the SCIP pointer to the scenario
| scenario | the scenario |
Definition at line 265 of file reader_sto.c.
References assert(), NULL, and StoScenario::scip.
Referenced by addScenarioVarsAndConsToProb(), buildDecompProblem(), and getScenarioDecompVar().
|
static |
creates the subproblem array. This array will be the same size as the number of children
Definition at line 276 of file reader_sto.c.
References assert(), StoScenario::nchildren, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemoryArray, and StoScenario::subproblems.
Referenced by addScenarioVarsAndConsToProb(), and buildDecompProblem().
|
static |
adds a scenario to the subproblem array
| scenario | the scenario |
| subproblem | the subproblems data structure |
Definition at line 291 of file reader_sto.c.
References assert(), StoScenario::nchildren, StoScenario::nsubproblems, NULL, and StoScenario::subproblems.
Referenced by addScenarioVarsAndConsToProb(), and buildDecompProblem().
|
static |
returns the subproblem array for the scenario
| scenario | the scenario |
Definition at line 307 of file reader_sto.c.
References assert(), NULL, and StoScenario::subproblems.
Referenced by addScenarioVarsAndConsToProb(), and buildDecompProblem().
|
static |
returns the number of children for a given scenario
| scenario | the scenario |
Definition at line 318 of file reader_sto.c.
References assert(), StoScenario::nchildren, and NULL.
Referenced by addScenarioVarsAndConsToProb(), buildDecompProblem(), buildFullProblem(), buildScenarioTree(), and findScenarioInTree().
|
static |
returns a given child for a given scenario
| scenario | the scenario |
| childnum | the number of the desired child |
Definition at line 329 of file reader_sto.c.
References assert(), StoScenario::children, and NULL.
Referenced by addScenarioVarsAndConsToProb(), buildDecompProblem(), buildFullProblem(), and buildScenarioTree().
|
static |
returns the parent of a scenario
| scenario | the scenario |
Definition at line 342 of file reader_sto.c.
References assert(), NULL, and StoScenario::parent.
Referenced by computeScenarioProbability(), findScenarioVar(), and getScenarioDecompVar().
|
static |
sets the stage name
Definition at line 353 of file reader_sto.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPduplicateBlockMemoryArray, and StoScenario::stagename.
Referenced by buildScenariosFromBlocks(), copyScenario(), createReaderdata(), readBlocks(), readIndep(), and readScenarios().
|
static |
returns the stage name
Definition at line 369 of file reader_sto.c.
References assert(), NULL, and StoScenario::stagename.
Referenced by addScenarioVarsAndConsToProb(), buildScenariosFromBlocks(), buildScenarioTree(), and createScenariosFromBlocks().
|
static |
sets the stage num
Definition at line 382 of file reader_sto.c.
References assert(), NULL, SCIP_OKAY, and StoScenario::stagenum.
Referenced by buildScenariosFromBlocks(), copyScenario(), createScenariosFromBlocks(), and readScenarios().
|
static |
returns the stage num
Definition at line 398 of file reader_sto.c.
References assert(), NULL, and StoScenario::stagenum.
Referenced by addScenarioConsToProb(), addScenarioVarsAndConsToProb(), addScenarioVarsToProb(), findScenarioVar(), and getScenarioDecompVar().
|
static |
sets the scenario name
Definition at line 411 of file reader_sto.c.
References assert(), StoScenario::name, NULL, SCIP_CALL, SCIP_OKAY, and SCIPduplicateBlockMemoryArray.
Referenced by buildScenariosFromBlocks(), copyScenario(), createReaderdata(), readBlocks(), readIndep(), and readScenarios().
|
static |
returns the scenario name
| scenario | the scenario |
Definition at line 427 of file reader_sto.c.
References assert(), StoScenario::name, and NULL.
Referenced by findScenarioInTree(), readBlocks(), and readIndep().
|
static |
sets the scenario num
Definition at line 438 of file reader_sto.c.
References assert(), NULL, StoScenario::scenarionum, and SCIP_OKAY.
Referenced by buildScenariosFromBlocks(), copyScenario(), createScenariosFromBlocks(), and readScenarios().
|
static |
returns the scenario num
Definition at line 454 of file reader_sto.c.
References assert(), NULL, and StoScenario::scenarionum.
Referenced by addScenarioConsToProb(), addScenarioVarsAndConsToProb(), addScenarioVarsToProb(), findScenarioVar(), and getScenarioDecompVar().
|
static |
sets the scenario probability
Definition at line 467 of file reader_sto.c.
References assert(), NULL, StoScenario::probability, SCIP_OKAY, and SCIP_Real.
Referenced by copyScenario(), mergeScenarios(), readBlocks(), readIndep(), and readScenarios().
|
static |
returns the scenario probability
Definition at line 483 of file reader_sto.c.
References assert(), NULL, StoScenario::probability, and SCIP_Real.
Referenced by computeScenarioProbability(), copyScenario(), and mergeScenarios().
|
static |
sets the scenario lowerbound
Definition at line 496 of file reader_sto.c.
References assert(), StoScenario::lowerbound, NULL, SCIP_OKAY, and SCIP_Real.
Referenced by copyScenario(), and readScenarios().
|
static |
returns the scenario lowerbound
Definition at line 512 of file reader_sto.c.
References assert(), StoScenario::lowerbound, NULL, and SCIP_Real.
Referenced by addScenarioVarsAndConsToProb(), buildDecompProblem(), and copyScenario().
|
static |
add scenario entry
| scip | the SCIP data structure |
| scenario | the scenario |
| rowname | the row name for the entry |
| colname | the col name for the entry |
| value | the value for the entry |
Definition at line 525 of file reader_sto.c.
References assert(), StoScenario::colnames, StoScenario::entriessize, StoScenario::nentries, NULL, StoScenario::rownames, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcalcMemGrowSize(), SCIPduplicateBlockMemoryArray, SCIPreallocBlockMemoryArray, and StoScenario::values.
Referenced by copyScenario(), mergeScenarios(), readBlocks(), readIndep(), and readScenarios().
|
static |
returns the number of entries for a scenario
| scenario | the scenario |
Definition at line 557 of file reader_sto.c.
References assert(), StoScenario::nentries, and NULL.
Referenced by addScenarioVarsAndConsToProb().
|
static |
returns an entry row for a scenario
| scenario | the scenario |
| entry | the entry number |
Definition at line 568 of file reader_sto.c.
References assert(), NULL, and StoScenario::rownames.
Referenced by addScenarioVarsAndConsToProb().
|
static |
returns an entry column for a scenario
| scenario | the scenario |
| entry | the entry number |
Definition at line 581 of file reader_sto.c.
References assert(), StoScenario::colnames, and NULL.
Referenced by addScenarioVarsAndConsToProb().
|
static |
returns an entry value for a scenario
| scenario | the scenario |
| entry | the entry number |
Definition at line 594 of file reader_sto.c.
References assert(), NULL, SCIP_Real, and StoScenario::values.
Referenced by addScenarioVarsAndConsToProb().
|
static |
copies a scenario. In the case of blocks, the scenarios must be combined
| scip | the SCIP data structure |
| sourcescenario | the source scenario |
| targetscenario | the target scenario |
| copyname | should the name be copied? |
Definition at line 609 of file reader_sto.c.
References addScenarioEntry(), assert(), StoScenario::colnames, getScenarioLowerbound(), getScenarioProbability(), i, StoScenario::name, StoScenario::nentries, NULL, StoScenario::rownames, StoScenario::scenarionum, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, setScenarioLowerbound(), setScenarioName(), setScenarioNum(), setScenarioProbability(), setScenarioStageName(), setScenarioStageNum(), StoScenario::stagename, StoScenario::stagenum, and StoScenario::values.
Referenced by buildScenariosFromBlocks(), and scenarioAddChild().
|
static |
merge scenarios. In the case of blocks, the scenarios must be combined
| scip | the SCIP data structure |
| scenario1 | the first scenario |
| mergedscenario | the merged scenario |
Definition at line 652 of file reader_sto.c.
References addScenarioEntry(), assert(), StoScenario::colnames, getScenarioProbability(), i, StoScenario::nentries, NULL, StoScenario::rownames, SCIP_CALL, SCIP_OKAY, SCIP_Real, setScenarioProbability(), and StoScenario::values.
Referenced by buildScenariosFromBlocks().
|
static |
adds a child to a given scenario
Definition at line 679 of file reader_sto.c.
References assert(), StoScenario::children, copyScenario(), createScenarioData(), StoScenario::nchildren, NULL, StoScenario::parent, SCIP_CALL, SCIP_OKAY, SCIPensureBlockMemoryArray, and TRUE.
Referenced by buildScenarioTree(), and insertScenarioInReaderdata().
|
static |
recursively adds the scenarios to the reader data
| scip | the SCIP data structure |
| scenariotree | the scenario tree |
| scenarios | the array of scenarios |
| numscenarios | the number of scenarios per stage |
| numstages | the number of stages |
| stage | the number of the stage. Also the depth of the tree |
Definition at line 707 of file reader_sto.c.
References assert(), buildScenarioTree(), getScenarioChild(), getScenarioNChildren(), getScenarioStageName(), i, NULL, scenarioAddChild(), SCIP_CALL, SCIP_OKAY, and SCIPtimGetStageName().
Referenced by addScenariosToReaderdata(), and buildScenarioTree().
|
static |
| scip | the SCIP data structure |
| readerdata | the reader data |
| scenarios | the array of scenarios |
| numscenarios | the number of scenarios per stage |
| numscenariostages | the number of stages for which scenarios were collected |
Definition at line 753 of file reader_sto.c.
References assert(), buildScenarioTree(), i, NULL, SCIP_CALL, SCIP_OKAY, and SCIPtimGetNStages().
Referenced by createScenariosFromBlocks().
|
static |
finds a scenario with a given name
| scenariotree | the scenario tree to search |
| scenname | the name of the scenario to search |
Definition at line 780 of file reader_sto.c.
References StoScenario::children, findScenarioInTree(), getScenarioName(), getScenarioNChildren(), i, and NULL.
Referenced by findScenarioInTree(), and insertScenarioInReaderdata().
|
static |
inserts a scenario into the reader data scenario tree
| scip | the SCIP data structure |
| readerdata | the reader data |
| scenario | the scenario to insert in the scenario tree |
| parentname | the parent scenario for the inserting scenario |
Definition at line 807 of file reader_sto.c.
References assert(), findScenarioInTree(), NULL, scenarioAddChild(), SCIP_CALL, and SCIP_OKAY.
Referenced by readScenarios().
|
static |
| scip | the SCIP data structure |
| blocks | the block that form the scenarios |
| scenarios | the array to store the scenarios |
| blocksforscen | the blocks that will form the scenario |
| numblocksforscen | the number of blocks that form the scenario |
| numblocks | the number of blocks |
| numblocksperblock | the number of blocks for a given block |
| numscenarios | the number of scenarios |
| scenariossize | the size of scenarios array |
| stage | the stage for this scenario |
| stagenum | the number of the stage |
| blocknum | the block number |
Definition at line 834 of file reader_sto.c.
References assert(), buildScenariosFromBlocks(), copyScenario(), createScenarioData(), FALSE, getScenarioStageName(), i, mergeScenarios(), NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPcalcMemGrowSize(), SCIPreallocBlockMemoryArray, SCIPsnprintf(), setScenarioName(), setScenarioNum(), setScenarioStageName(), setScenarioStageNum(), and TRUE.
Referenced by buildScenariosFromBlocks(), and createScenariosFromBlocks().
|
static |
| scip | the SCIP data structure |
| readerdata | the reader data |
| blocks | the block that form the scenarios |
| numblocks | the number of blocks |
| numblocksperblock | the number of blocks for each block type |
| numstages | the number of stages |
Definition at line 931 of file reader_sto.c.
References addScenariosToReaderdata(), assert(), buildScenariosFromBlocks(), freeScenarioTree(), getScenarioStageName(), i, NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPfreeBlockMemoryArray, SCIPfreeBufferArray, SCIPsnprintf(), setScenarioNum(), setScenarioStageNum(), and STO_DEFAULT_BLOCKARRAYSIZE.
Referenced by readBlocks(), and readIndep().
|
static |
creates the reader data
Definition at line 1007 of file reader_sto.c.
References assert(), createScenarioData(), NULL, SCIP_CALL, SCIP_OKAY, SCIPtimGetStageName(), setScenarioName(), setScenarioStageName(), and TRUE.
Referenced by readSto().
|
static |
frees the reader data
Definition at line 1032 of file reader_sto.c.
References assert(), FALSE, freeScenarioTree(), NULL, SCIP_CALL, and SCIP_OKAY.
Referenced by SCIP_DECL_READERFREE(), SCIPfreeReaderdataSto(), and SCIPreadSto().
|
static |
creates the sto input structure
Definition at line 1054 of file reader_sto.c.
References assert(), FALSE, StoInput::fp, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, STO_STOCH, and STO_STOCHINFO_NONE.
Referenced by readSto().
free the sto input structure
Definition at line 1086 of file reader_sto.c.
References SCIPfreeBlockMemory.
Referenced by readSto().
|
static |
returns the current section
| stoi | sto input structure |
Definition at line 1096 of file reader_sto.c.
References assert(), NULL, and StoInput::section.
Referenced by readSto().
|
static |
returns the stochastic information type
| stoi | sto input structure |
Definition at line 1107 of file reader_sto.c.
References assert(), NULL, and StoInput::stochinfotype.
Referenced by readSto().
|
static |
return the current value of field 0
| stoi | sto input structure |
Definition at line 1118 of file reader_sto.c.
References assert(), StoInput::f0, and NULL.
Referenced by readBlocks(), readIndep(), readScenarios(), and readStoch().
|
static |
return the current value of field 1
| stoi | sto input structure |
Definition at line 1129 of file reader_sto.c.
References assert(), StoInput::f1, and NULL.
Referenced by readBlocks(), readIndep(), readScenarios(), and readStoch().
|
static |
return the current value of field 2
| stoi | sto input structure |
Definition at line 1140 of file reader_sto.c.
References assert(), StoInput::f2, and NULL.
Referenced by readBlocks(), readIndep(), and readScenarios().
|
static |
return the current value of field 3
| stoi | sto input structure |
Definition at line 1151 of file reader_sto.c.
References assert(), StoInput::f3, and NULL.
Referenced by readBlocks(), readIndep(), and readScenarios().
|
static |
return the current value of field 4
| stoi | sto input structure |
Definition at line 1162 of file reader_sto.c.
References assert(), StoInput::f4, and NULL.
Referenced by readBlocks(), readIndep(), and readScenarios().
|
static |
return the current value of field 5
| stoi | sto input structure |
Definition at line 1173 of file reader_sto.c.
References assert(), StoInput::f5, and NULL.
Referenced by readIndep(), and readScenarios().
|
static |
return the current value of field 6
| stoi | sto input structure |
Definition at line 1184 of file reader_sto.c.
References assert(), StoInput::f6, and NULL.
Referenced by readScenarios().
returns if an error was detected
| stoi | sto input structure |
Definition at line 1195 of file reader_sto.c.
References assert(), StoInput::haserror, NULL, and SCIP_Bool.
Referenced by readSto().
|
static |
set the section in the sto input structure to given section
| stoi | sto input structure |
| section | section that is set |
Definition at line 1206 of file reader_sto.c.
References assert(), NULL, and StoInput::section.
Referenced by readBlocks(), readIndep(), readScenarios(), and readStoch().
|
static |
set the stochastic info type in the sto input structure
| stoi | sto input structure |
| stochinfotype | the stochastic infomation type |
Definition at line 1218 of file reader_sto.c.
References assert(), NULL, and StoInput::stochinfotype.
Referenced by readStoch().
|
static |
set the problem name in the sto input structure to given problem name
| stoi | sto input structure |
| probname | name of the problem to set |
Definition at line 1230 of file reader_sto.c.
References assert(), NULL, StoInput::probname, SCIPmemccpy(), and STO_MAX_NAMELEN.
Referenced by readStoch().
|
static |
set the type name in the sto input structure to given objective name
| stoi | sto input structure |
| stochtype | name of the scenario type |
Definition at line 1244 of file reader_sto.c.
References assert(), NULL, SCIPmemccpy(), STO_MAX_NAMELEN, and StoInput::stochtype.
Referenced by readBlocks(), readIndep(), and readScenarios().
|
static |
| stoi | sto input structure |
Definition at line 1257 of file reader_sto.c.
References assert(), StoInput::haserror, StoInput::lineno, NULL, SCIPerrorMessage, StoInput::section, STO_ENDATA, and TRUE.
Referenced by readBlocks(), readIndep(), readScenarios(), readSto(), and readStoch().
|
static |
fill the line from pos up to column 80 with blanks.
| buf | buffer to clear |
| pos | position to start the clearing process |
Definition at line 1270 of file reader_sto.c.
References BLANK, StoInput::buf, and i.
Referenced by stoinputReadLine().
read a sto format data line and parse the fields.
| stoi | sto input structure |
Definition at line 1284 of file reader_sto.c.
References assert(), BLANK, StoInput::buf, clearFrom(), StoInput::f0, StoInput::f1, StoInput::f2, StoInput::f3, StoInput::f4, StoInput::f5, StoInput::f6, FALSE, StoInput::fp, i, StoInput::lineno, NULL, SCIP_Bool, SCIPdebugMessage, SCIPfgets(), SCIPstrtok(), STO_MAX_LINELEN, and TRUE.
Referenced by readBlocks(), readIndep(), readScenarios(), and readStoch().
|
static |
Process STOCH section.
Definition at line 1393 of file reader_sto.c.
References assert(), NULL, SCIP_OKAY, SCIPdebugMsg, STO_BLOCKS, STO_INDEP, STO_SCENARIOS, STO_STOCHINFO_DISCRETE, STO_STOCHINFO_LINTR, STO_STOCHINFO_NORMAL, STO_STOCHINFO_SUB, STO_STOCHINFO_UNIFORM, stoinputField0(), stoinputField1(), stoinputReadLine(), stoinputSetProbname(), stoinputSetSection(), stoinputSetStochInfoType(), and stoinputSyntaxerror().
Referenced by readSto().
|
static |
Process BLOCKS section.
Definition at line 1455 of file reader_sto.c.
References addScenarioEntry(), createScenarioData(), createScenariosFromBlocks(), FALSE, freeScenarioTree(), getScenarioName(), i, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPcalcMemGrowSize(), SCIPdebugMsg, SCIPerrorMessage, SCIPfreeBlockMemoryArray, SCIPreallocBlockMemoryArray, SCIPsnprintf(), setScenarioName(), setScenarioProbability(), setScenarioStageName(), STO_BLOCKS, STO_DEFAULT_ARRAYSIZE, STO_DEFAULT_BLOCKARRAYSIZE, STO_ENDATA, stoinputField0(), stoinputField1(), stoinputField2(), stoinputField3(), stoinputField4(), stoinputReadLine(), stoinputSetSection(), stoinputSetStochtype(), stoinputSyntaxerror(), and TRUE.
Referenced by readSto().
|
static |
Process SCENARIOS section.
Definition at line 1620 of file reader_sto.c.
References addScenarioEntry(), assert(), createScenarioData(), FALSE, freeScenarioTree(), insertScenarioInReaderdata(), NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPdebugMsg, SCIPerrorMessage, SCIPsnprintf(), SCIPtimFindStage(), setScenarioLowerbound(), setScenarioName(), setScenarioNum(), setScenarioProbability(), setScenarioStageName(), setScenarioStageNum(), STO_ENDATA, STO_SCENARIOS, stoinputField0(), stoinputField1(), stoinputField2(), stoinputField3(), stoinputField4(), stoinputField5(), stoinputField6(), stoinputReadLine(), stoinputSetSection(), stoinputSetStochtype(), stoinputSyntaxerror(), and TRUE.
Referenced by readSto().
|
static |
Process INDEP section.
Definition at line 1763 of file reader_sto.c.
References addScenarioEntry(), createScenarioData(), createScenariosFromBlocks(), FALSE, freeScenarioTree(), getScenarioName(), i, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPcalcMemGrowSize(), SCIPdebugMsg, SCIPfreeBlockMemoryArray, SCIPreallocBlockMemoryArray, SCIPsnprintf(), SCIPtimConsGetStageName(), setScenarioName(), setScenarioProbability(), setScenarioStageName(), STO_DEFAULT_ARRAYSIZE, STO_DEFAULT_BLOCKARRAYSIZE, STO_ENDATA, STO_INDEP, stoinputField0(), stoinputField1(), stoinputField2(), stoinputField3(), stoinputField4(), stoinputField5(), stoinputReadLine(), stoinputSetSection(), stoinputSetStochtype(), stoinputSyntaxerror(), and TRUE.
Referenced by readSto().
|
static |
computes the probability of a scenario
Definition at line 1932 of file reader_sto.c.
References assert(), getScenarioParent(), getScenarioProbability(), NULL, and SCIP_Real.
Referenced by addScenarioVarsAndConsToProb(), and addScenarioVarsToProb().
|
static |
gets the variable name
| name | the name to be returned |
| varname | the root of the variable name |
| stagenum | the stage number |
| scenarionum | the scenario number |
Definition at line 1957 of file reader_sto.c.
References SCIP_MAXSTRLEN, and SCIPsnprintf().
Referenced by addScenarioConsToProb(), addScenarioVarsAndConsToProb(), addScenarioVarsToProb(), findScenarioVar(), and getScenarioDecompVar().
|
static |
add variables to the scenario
| scip | the SCIP data structure |
| scenario | the current scenario |
| varmap | the variable map from the original to the subproblem variables |
| vars | the variables of the core problem associated with this scenario |
| nvars | the number of variables for this scenario |
Definition at line 1973 of file reader_sto.c.
References assert(), computeScenarioProbability(), getScenarioEntityName(), getScenarioNum(), getScenarioStageNum(), i, NULL, nvars, obj, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddVar(), SCIPcreateVarImpl(), SCIPdebugMessage, SCIPhashmapInsert(), SCIPreleaseVar(), SCIPvarGetImplType(), SCIPvarGetLbOriginal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetType(), SCIPvarGetUbOriginal(), SCIPvarIsDeleted(), SCIPvarIsInitial(), SCIPvarIsRemovable(), var, and vars.
Referenced by addScenarioVarsAndConsToProb().
|
static |
finds the scenario variable to add to a constraint
| scip | the SCIP data structure |
| scenario | the current scenario |
| consvar | the variable in the constraint that is being searched for |
| scenariovar | pointer to return the variable to be added to the constraint |
Definition at line 2027 of file reader_sto.c.
References assert(), getScenarioEntityName(), getScenarioNum(), getScenarioParent(), getScenarioStageNum(), NULL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_READERROR, SCIPerrorMessage, SCIPfindVar(), SCIPsnprintf(), and SCIPvarGetName().
Referenced by addScenarioConsToProb().
|
static |
create variable for the decomposed scenario
| scip | the SCIP data structure |
| scenario | the current scenario |
| consvar | the variable in the constraint that is being searched for |
| scenariovar | pointer to return the variable to be added to the constraint |
| varadded | pointer to indicate whether a variable has been added |
Definition at line 2075 of file reader_sto.c.
References assert(), FALSE, getScenarioEntityName(), getScenarioNum(), getScenarioParent(), getScenarioScip(), getScenarioStageNum(), NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPaddVar(), SCIPcreateVarImpl(), SCIPdebugMessage, SCIPfindVar(), SCIPsnprintf(), SCIPvarGetImplType(), SCIPvarGetLbOriginal(), SCIPvarGetName(), SCIPvarGetType(), SCIPvarGetUbOriginal(), SCIPvarIsInitial(), SCIPvarIsRemovable(), TRUE, and var.
Referenced by addScenarioConsToProb().
|
static |
adds the constraint to the scenario problem
| scip | the SCIP data structure |
| scenarioscip | the scenario SCIP data structure |
| scenario | the current scenario |
| varmap | the variable map from the original to the subproblem variables |
| conss | the constraints of the core problem associated with this scenario |
| nconss | the number of constraints for this scenario |
| decomp | is the problem being decomposed |
Definition at line 2144 of file reader_sto.c.
References assert(), FALSE, findScenarioVar(), getScenarioDecompVar(), getScenarioEntityName(), getScenarioNum(), getScenarioStageNum(), i, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_READERROR, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDeleted(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsMarkedPropagate(), SCIPconsIsModifiable(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPerrorMessage, SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPgetConsCopy(), SCIPgetConsNVars(), SCIPgetConsVars(), SCIPhashmapExists(), SCIPhashmapInsert(), SCIPreleaseCons(), SCIPreleaseVar(), and TRUE.
Referenced by addScenarioVarsAndConsToProb().
|
static |
add variables and constraint to problem
| scip | the SCIP data structure of master problem |
| scenario | the current scenario |
| decomp | is the problem being decomposed |
Definition at line 2263 of file reader_sto.c.
References addScenarioConsToProb(), addScenarioSubproblem(), addScenarioVarsAndConsToProb(), addScenarioVarsToProb(), assert(), computeScenarioProbability(), createScenarioSubproblemArray(), getScenarioChild(), getScenarioEntityName(), getScenarioEntryCol(), getScenarioEntryRow(), getScenarioEntryValue(), getScenarioLowerbound(), getScenarioNChildren(), getScenarioNEntries(), getScenarioNum(), getScenarioScip(), getScenarioStageName(), getScenarioStageNum(), getScenarioSubproblemArray(), i, NULL, nvars, obj, RHS, RIGHT, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPbendersUpdateSubproblemLowerbound(), SCIPblkmem(), SCIPchgCoefLinear(), SCIPchgLhsLinear(), SCIPchgRhsLinear(), SCIPchgVarObj(), SCIPcreate(), SCIPcreateBendersDefault(), SCIPcreateProbBasic(), SCIPdebugMessage, SCIPenableDebugSol(), SCIPerrorMessage, SCIPfindBenders(), SCIPfindCons(), SCIPfindVar(), SCIPgetLhsLinear(), SCIPgetNVars(), SCIPgetProbName(), SCIPgetRhsLinear(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPincludeDefaultPlugins(), SCIPinfinity(), SCIPisLT(), SCIPsetBoolParam(), SCIPsnprintf(), SCIPtimFindStage(), SCIPtimGetNStages(), SCIPtimGetStageConss(), SCIPtimGetStageNConss(), SCIPtimGetStageNVars(), SCIPtimGetStageVars(), setScenarioScip(), TRUE, var, and vars.
Referenced by addScenarioVarsAndConsToProb(), buildDecompProblem(), and buildFullProblem().
|
static |
removes the core variables and constriants for stage 2 and lower
Definition at line 2472 of file reader_sto.c.
References assert(), i, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsIsDeleted(), SCIPdelCons(), SCIPdelVar(), SCIPtimGetNStages(), SCIPtimGetStageConss(), SCIPtimGetStageNConss(), SCIPtimGetStageNVars(), SCIPtimGetStageVars(), SCIPvarIsDeleted(), and vars.
Referenced by buildDecompProblem(), and buildFullProblem().
|
static |
Definition at line 2522 of file reader_sto.c.
References addScenarioVarsAndConsToProb(), assert(), FALSE, getScenarioChild(), getScenarioNChildren(), i, NULL, removeCoreVariablesAndConstraints(), SCIP_CALL, and SCIP_OKAY.
Referenced by readSto().
|
static |
builds the stochastic program using Benders' decomposition
Definition at line 2546 of file reader_sto.c.
References addScenarioSubproblem(), addScenarioVarsAndConsToProb(), assert(), createScenarioSubproblemArray(), getScenarioChild(), getScenarioLowerbound(), getScenarioNChildren(), getScenarioScip(), getScenarioSubproblemArray(), i, NULL, removeCoreVariablesAndConstraints(), SCIP_CALL, SCIP_OKAY, SCIP_PARAMSETTING_OFF, SCIPbendersUpdateSubproblemLowerbound(), SCIPcreateBendersDefault(), SCIPfindBenders(), SCIPsetBoolParam(), SCIPsetIntParam(), SCIPsetPresolving(), setScenarioScip(), and TRUE.
Referenced by readSto().
|
static |
Read the stochastic information of an SMPS file instance in "STO File Format".
Definition at line 2606 of file reader_sto.c.
References assert(), buildDecompProblem(), buildFullProblem(), createReaderdata(), FALSE, StoInput::fp, NULL, readBlocks(), readIndep(), readScenarios(), readStoch(), SCIP_Bool, SCIP_CALL_FINALLY, SCIP_CALL_TERMINATE, SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, SCIPerrorMessage, SCIPfclose(), SCIPfopen(), SCIPinfoMessage(), SCIPprintSysError(), SCIPtimGetNStages(), STO_BLOCKS, STO_ENDATA, STO_INDEP, STO_SCENARIOS, STO_STOCHINFO_DISCRETE, stoinputCreate(), stoinputFree(), stoinputHasError(), stoinputSection(), stoinputStochInfoType(), stoinputSyntaxerror(), and TRUE.
Referenced by SCIPreadSto().
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 2705 of file reader_sto.c.
References assert(), NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeReaderSto(), and SCIPreaderGetName().
|
static |
destructor of reader to free user data (called when SCIP is exiting)
Definition at line 2719 of file reader_sto.c.
References assert(), freeReaderdata(), NULL, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPreaderGetData(), and SCIPreaderGetName().
|
static |
problem reading method of reader
Definition at line 2736 of file reader_sto.c.
References assert(), NULL, READER_NAME, result, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_OKAY, SCIPcorHasRead(), SCIPfindReader(), SCIPreaderGetName(), SCIPreadSto(), SCIPtimHasRead(), and SCIPwarningMessage().