sugestions to solve a problem
Posted: Sun Sep 12, 2010 4:23 pm
hello every body, sorry if a have mistakes with my english, definetly is not my home language, but i will try to explain the more simple as posible. Here is my problem:
I have thousand of students who meed to take an exam they are splited in groups (ie: A=300 students, B=100 students ,C=200 students ). Also i have some classrooms whith its capacity (ie: room1:60, room2:80, room3:40, room4:50, room5:100, room6:70....) the deal is that my php application have to order students in the classrooms.
I was making my code like this:
but I don't know how to do it. I was searching on the internet and i found that i have to use some algorithms like genetic algorithms. is it true? and how can i solve this?.
thanks for your answers
I have thousand of students who meed to take an exam they are splited in groups (ie: A=300 students, B=100 students ,C=200 students ). Also i have some classrooms whith its capacity (ie: room1:60, room2:80, room3:40, room4:50, room5:100, room6:70....) the deal is that my php application have to order students in the classrooms.
I was making my code like this:
Code: Select all
$students = array();
$students[0]["Group"] ="A";
$students[0]["students"] =300;
$students[1]["Group"] ="B";
$students[1]["students"] =100;
$students[2]["Group"] ="C";
$students[2]["students"] =200;
$rooms = array();
$rooms[0]['Id']="room_1";
$rooms[0]['Capacity']=60;
$rooms[1]['Id']="room_2";
$rooms[1]['Capacity']=80;
$rooms[2]['Id']="room_3";
$rooms[2]['Capacity']=40;
$rooms[3]['Id']="room_4";
$rooms[3]['Capacity']=50;
$rooms[4]['Id']="room_5";
$rooms[4]['Capacity']=100;
$rooms[5]['Id']="room_6";
$rooms[5]['Capacity']=70;
$rooms[6]['Id']="room_7";
$rooms[6]['Capacity']=70;
$rooms[7]['Id']="room_8";
$rooms[7]['Capacity']=70;
$rooms[8]['Id']="room_9";
$rooms[8]['Capacity']=80;thanks for your answers