ECF 1.5
FlowshopEvalOp.h
1#ifndef FlowshopEvalOp_h
2#define FlowshopEvalOp_h
3
4#include "../API/Problem.h"
5#include "flowshop.h"
6
7
8class FlowshopMove : public Move
9{
10public:
11 struct move* v;
12 FlowshopMove(struct move* _v = 0)
13 { v = _v; }
14};
15
16
17class FlowshopPath : public Path
18{
19public:
20 struct pathState* ps;
21 FlowshopPath(struct pathState* _ps = 0)
22 { ps = _ps; }
23};
24
25
26class FlowshopEvalOp : public Problem
27{
28public:
29 StateP state_;
30
31 // ECF methods
32 void registerParameters(StateP);
33 bool initialize(StateP);
34 FitnessP evaluate(IndividualP individual);
35
36 // API methods
37 MoveP randomMove(IndividualP);
38 bool applyMove(IndividualP&, MoveP);
39 PathP initPathTo(IndividualP, IndividualP);
40 int getPathLength(PathP);
41 MoveP nextRandomMove(PathP);
42
43 // reusable objects from the original code
44 struct problem* problemInstance;
45 struct solution *solutionInstance, *solutionInstance2;
46 struct move* moveInstance;
47 struct pathState* psInstance;
48 void populateSolutionInstance(IndividualP, struct solution*);
49 void readSolutionInstance(IndividualP, struct solution*);
50};
51typedef boost::shared_ptr<FlowshopEvalOp> FlowshopEvalOpP;
52
53#endif FlowshopEvalOp_h
bool initialize(StateP)
Initialize the evaluator. Called before first evaluation occurs.
void registerParameters(StateP)
Register evaluator parameters. Called before EvaluateOp::initialize method.
FitnessP evaluate(IndividualP individual)
Evaluate a single individual. Method must create and return a Fitness object.
Definition: Problem.h:9
Definition: Problem.h:17
Definition: flowshop.h:78