code:ga_scheduling
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
code:ga_scheduling [2009/01/11 12:43] – pkubanek | code:ga_scheduling [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 6: | Line 6: | ||
Important is to remember that lower constraint violation value means better schedule, and higher objective function value means better schedule. If you come to objective which naturally produces better schedules when lower value is calculated, you can easily change function by using //1/f(x)// instead. | Important is to remember that lower constraint violation value means better schedule, and higher objective function value means better schedule. If you come to objective which naturally produces better schedules when lower value is calculated, you can easily change function by using //1/f(x)// instead. | ||
+ | |||
+ | In order to use GA scheduling, you will need to fill in database. You will also find it useful to use //pyrts2// to visualise schedule, so you will be able to see how scheduling algorithm behaves. | ||
+ | |||
+ | ===== Database setup ===== | ||
+ | |||
+ | //Note: Currently you need to build database from REL_0_8_0 branch. See bellow how to retrieve it.// | ||
+ | |||
+ | You need to fill **tickets** and **accounts** tables. | ||
+ | |||
+ | **Tickets** table contains those fields: | ||
+ | |||
+ | ^ Field name ^ Data type ^ Description ^ | ||
+ | | schedticket_id | ||
+ | | tar_id | ||
+ | | account_id | ||
+ | | obs_num | ||
+ | | sched_from | ||
+ | | sched_to | ||
+ | | sched_interval_min | interval | ||
+ | | sched_interval_max | interval | ||
+ | |||
+ | ===== Using pyrts2 to preview schedules ===== | ||
+ | |||
+ | |||
+ | ====== Obtaining and modifying code ====== | ||
The GA scheduler code currently lives only in [[http:// | The GA scheduler code currently lives only in [[http:// | ||
Line 129: | Line 154: | ||
constraints.push_back (CONSTR_OBS_NUM); | constraints.push_back (CONSTR_OBS_NUM); | ||
} | } | ||
+ | </ | ||
+ | |||
+ | ===== Adding new objective function ===== | ||
+ | |||
+ | Process of adding new objective function is similar to adding new constraint. If you understand how constraint functions are added, you will not have any problems understanding how objectives are added. | ||
+ | |||
+ | You will need to add new objective symbolic name to objFunc enumeration. In [[http:// | ||
+ | |||
+ | <code c++> | ||
+ | const char* getObjectiveName (objFunc obj) | ||
+ | { | ||
+ | const static char* objNames[] = { " | ||
+ | " | ||
+ | return objNames[(int) obj]; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Then procedure is similar - add objective to case in // | ||
+ | |||
+ | And finally add it to // | ||
+ | |||
+ | <code c++> | ||
+ | // fill in parameters for NSGA | ||
+ | objectives.push_back (ALTITUDE); | ||
+ | objectives.push_back (ACCOUNT); | ||
+ | objectives.push_back (DISTANCE); | ||
+ | objectives.push_back (DIVERSITY_TARGET); | ||
+ | |||
</ | </ |
code/ga_scheduling.1231674208.txt.gz · Last modified: 2009/01/11 00:00 (external edit)