use eoExceptions everywhere
This commit is contained in:
parent
75ac37b02a
commit
eba2e14950
127 changed files with 524 additions and 418 deletions
|
|
@ -36,6 +36,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <eo>
|
||||
#include "FlowShopBenchmarkParser.h"
|
||||
|
||||
FlowShopBenchmarkParser::FlowShopBenchmarkParser(const std::string _benchmarkFileName)
|
||||
|
|
@ -96,7 +97,7 @@ void FlowShopBenchmarkParser::init(const std::string _benchmarkFileName)
|
|||
std::ifstream inputFile(_benchmarkFileName.data(), std::ios::in);
|
||||
// opening of the benchmark file
|
||||
if (! inputFile)
|
||||
throw std::runtime_error("*** ERROR : Unable to open the benchmark file");
|
||||
throw eoFileError(_benchmarkFileName);
|
||||
// number of jobs (N)
|
||||
getline(inputFile, buffer, '\n');
|
||||
N = atoi(buffer.data());
|
||||
|
|
|
|||
|
|
@ -104,12 +104,12 @@ eoGenOp<FlowShop> & do_make_op(eoParameterLoader& _parser, eoState& _state)
|
|||
eoValueParam<double>& pCrossParam = _parser.createParam(0.25, "pCross", "Probability of Crossover", 'c', "Variation Operators" );
|
||||
// minimum check
|
||||
if ( (pCrossParam.value() < 0) || (pCrossParam.value() > 1) )
|
||||
throw std::runtime_error("Invalid pCross");
|
||||
throw eoParamException("Invalid pCross");
|
||||
|
||||
eoValueParam<double>& pMutParam = _parser.createParam(0.35, "pMut", "Probability of Mutation", 'm', "Variation Operators" );
|
||||
// minimum check
|
||||
if ( (pMutParam.value() < 0) || (pMutParam.value() > 1) )
|
||||
throw std::runtime_error("Invalid pMut");
|
||||
throw eoParamException("Invalid pMut");
|
||||
|
||||
// the crossover - with probability pCross
|
||||
eoProportionalOp<FlowShop> * propOp = new eoProportionalOp<FlowShop> ;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue