MS-RCPSP
|
Base abstract class for specimen (schedule) representations. More...
#include <Schedule.h>
Public Member Functions | |
void | printState (bool short_output) |
void | writeToFile (FILE *stream) |
int | size () |
int | fitness () |
int | resource (int i) const |
int | max_res_count (int i) const |
virtual void | reset ()=0 |
Public Attributes | |
int * | ires |
int * | start |
Protected Member Functions | |
Schedule (int *_ires) | |
int | finish_time (int i) const |
virtual int | compute_fitness ()=0 |
Protected Attributes | |
int | n |
int | _fitness = -1 |
Task ** | tasks |
Friends | |
class | Validator |
Base abstract class for specimen (schedule) representations.
If you want to implement your own representation of schedule, you must create a subclass of Schedule and implement Schedule::compute_fitness function. Then you have to instantiate all Crossover and Mutator operators you're going to use for your new subclass. For instantiation example see src/UniformCrossover.cpp. Finally, you have to define equality operator, for clone removal to work.
Definition at line 22 of file Schedule.h.
|
protectedpure virtual |
Computes fitness and writes it to Schedule::_fitness cache variable.
Implemented in SchedulingProblem::PrioSchedule.
|
inlineprotected |
Returns finish time of the task at index i.
i | Index of the task. |
Definition at line 82 of file Schedule.h.
int SchedulingProblem::Schedule::fitness | ( | ) |
Calculates fitness function. Caches result in _fitness.
Definition at line 11 of file Schedule.cpp.
|
inline |
Returns number of resources capable of performing task at index i.
i | Index of the task. |
Definition at line 57 of file Schedule.h.
void SchedulingProblem::Schedule::printState | ( | bool | short_output | ) |
Prints current state to stdout.
Definition at line 18 of file Schedule.cpp.
|
pure virtual |
Reset schedule representation to random state.
Implemented in SchedulingProblem::PrioSchedule, and SchedulingProblem::SimpleSchedule.
|
inline |
Returns index of resource assigned to the task at index i.
i | Index of the task. |
Definition at line 51 of file Schedule.h.
|
inline |
Returns number of tasks.
Definition at line 39 of file Schedule.h.
void SchedulingProblem::Schedule::writeToFile | ( | FILE * | stream | ) |
Outputs solution to file stream in compatible format.
Definition at line 27 of file Schedule.cpp.
|
protected |
Cached fitness value for this specimen.
Definition at line 73 of file Schedule.h.
int* SchedulingProblem::Schedule::ires |
List of resources assigned to corresponding tasks.
Definition at line 33 of file Schedule.h.
|
protected |
Number of tasks.
Definition at line 67 of file Schedule.h.
int* SchedulingProblem::Schedule::start |
List of task start times.
Definition at line 36 of file Schedule.h.
|
protected |
List of tasks to complete. Shortcut to Project::tasks.
Definition at line 76 of file Schedule.h.