Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Osobnik znajdzNajlepszego(Graf graf){
- int index = 0;
- while (index == 0) index = SII.randInt(rozmiar-1);
- List<Osobnik> temp = new ArrayList<Osobnik>();
- for (int i = 0; i<15; i++){
- temp.add(this.getOsobnicy().get(SII.randInt(rozmiar-1)));
- }
- Osobnik najlepszy = temp.get(0);
- for (int i = 1; i<15; i++){
- if (graf.funkcjaOceny(najlepszy) > graf.funkcjaOceny(temp.get(i))) najlepszy = temp.get(i);
- }
- return najlepszy;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement