Advertisement
patryk

Untitled

Dec 29th, 2014
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.93 KB | None | 0 0
  1. #include <iostream>
  2. #include<conio.h>
  3. #include<math.h>
  4. #include<fstream>
  5. #include<cstdlib>
  6. #include<string>
  7. #include<time.h>
  8. #include<stdio.h>
  9. #include<stdlib.h>
  10.  
  11.  
  12. using namespace std;
  13.  
  14.  
  15. //------------TASK-STRUCTURE-----------
  16. struct Task{
  17.     int start_time;
  18.     int length;
  19.     bool interval;
  20.     int number;
  21.     Task *next;
  22. };
  23.  
  24.  
  25. //------------SOLUTION-STRUCTURE---------------
  26. struct Solution {
  27.     Task *machine_1_sequence;
  28.     Task *machine_2_sequence;
  29. };
  30.  
  31.  
  32. //-----------POPULATION-STRUCTURE--------------
  33. struct Population {
  34.     Solution *next;
  35. };
  36.  
  37.  
  38. //---------GLOBAL-VARIABLES----------------
  39. Task *machine1_operations;
  40. Task *machine2_operations;
  41.  
  42. Task *machine1_intervals;
  43. Task *machine2_intervals;
  44.  
  45.  
  46. void mutation(Task &task) {
  47.  
  48. }
  49.  
  50. void crossing(Task &task1, Task &task2) {
  51.  
  52. }
  53.  
  54. void selection(Population &pop) {
  55.  
  56. }
  57.  
  58. void generate_population() {
  59.  
  60. }
  61.  
  62.  
  63. void load_instance() {
  64.     // TU ZROB TYLKO DODAWANIE DO STRUKTURY, A NIE OTWIERANIE PLIKU.
  65. }
  66.  
  67. void save_results(){
  68.  
  69. }
  70.  
  71. int main() {
  72.  
  73.     // TU BEDZIE SIE ZACZYNAC PETLA KTORA BEDZIE OTWIERAC PLIKI PO KOLEJI.
  74.         load_instance(NAZWA_PLIKU);
  75.  
  76.         Task *wsk;
  77.         wsk=machine1_intervals;
  78.  
  79.         while(wsk->next)
  80.             {
  81.             cout<< wsk->number << "   " << wsk->length <<endl;
  82.             wsk=wsk->next;
  83.         }
  84.  
  85.  
  86.  
  87.         // generate_population();
  88.        
  89.         /*
  90.         while(jakis_czas_pewnie_20_minut) {
  91.             // DLA KAZDEGO ROZWIAZANIA Z NASZEJ POPULACJI
  92.                 //Losowanie czy ma byc mutacja - prawdopodobienstwo 30%
  93.                 mutation();
  94.            
  95.                 //Losowanie czy ma byc krzyzowanie - prawdopodobienstwo 60%
  96.                 crossover();
  97.             // KONIEC DLA WSZYSTKICH ROZWIAZAN
  98.            
  99.             selection();
  100.         }
  101.         */
  102.  
  103.         save_results();
  104.  
  105.     // ZAMKNIECIE PETLI KTORA BEDZIE OTWIERAC PLIKI
  106.     return 0;
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement