GCC 4.3 compatible
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1240 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
33f3b82974
commit
ea6fce84f2
2 changed files with 81 additions and 80 deletions
|
|
@ -34,7 +34,7 @@
|
|||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <FlowShopBenchmarkParser.h>
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ const std::vector<unsigned int> FlowShopBenchmarkParser::getD()
|
|||
|
||||
|
||||
void FlowShopBenchmarkParser::printOn(std::ostream & _os) const
|
||||
{
|
||||
{
|
||||
_os << "M=" << M << " N=" << N << std::endl;
|
||||
_os << "*** processing times" << std::endl;
|
||||
for (unsigned int i=0; i<M; i++)
|
||||
|
|
@ -86,7 +86,7 @@ void FlowShopBenchmarkParser::printOn(std::ostream & _os) const
|
|||
_os << d[j] << " ";
|
||||
}
|
||||
_os << std::endl << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FlowShopBenchmarkParser::init(const std::string _benchmarkFileName)
|
||||
|
|
@ -106,8 +106,12 @@ void FlowShopBenchmarkParser::init(const std::string _benchmarkFileName)
|
|||
// initial and current seeds (not used)
|
||||
getline(inputFile, buffer, '\n');
|
||||
// processing times and due-dates
|
||||
//p = std::vector< std::vector<unsigned int> > (M,N);
|
||||
p.resize(N);
|
||||
// p = std::vector< std::vector<unsigned int> > (M,N);
|
||||
p.resize(M);
|
||||
for (unsigned int j=0 ; j<M ; j++)
|
||||
{
|
||||
p[j].resize(N);
|
||||
}
|
||||
d = std::vector<unsigned int> (N);
|
||||
// for each job...
|
||||
for (unsigned int j=0 ; j<N ; j++)
|
||||
|
|
@ -120,7 +124,6 @@ void FlowShopBenchmarkParser::init(const std::string _benchmarkFileName)
|
|||
// processing times of the job j on each machine
|
||||
getline(inputFile, buffer, '\n');
|
||||
start = buffer.find_first_not_of(" ");
|
||||
p[j].resize(M);
|
||||
for (unsigned int i=0 ; i<M ; i++)
|
||||
{
|
||||
end = buffer.find_first_of(" ", start);
|
||||
|
|
|
|||
|
|
@ -77,14 +77,12 @@ double FlowShopEval::tardiness(const FlowShop & _flowshop)
|
|||
|
||||
std::vector< std::vector<unsigned int> > FlowShopEval::completionTime(const FlowShop & _flowshop)
|
||||
{
|
||||
//std::vector< std::vector<unsigned int> > C(M,N);
|
||||
std::vector< std::vector<unsigned int> > C;
|
||||
C.resize(M);
|
||||
for(unsigned int i=0;i<N;i++)
|
||||
for (unsigned int i=0;i<M;i++)
|
||||
{
|
||||
C[i].resize(N);
|
||||
}
|
||||
|
||||
C[0][_flowshop[0]] = p[0][_flowshop[0]];
|
||||
for (unsigned int j=1; j<N; j++)
|
||||
C[0][_flowshop[j]] = C[0][_flowshop[j-1]] + p[0][_flowshop[j]];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue