This commit is contained in:
Mariusz Pacek committed 2012-12-18 00:01:04 +01:00
1 parent 5ba7f436f1
commit da69c137ea
3 files changed
+18 -21

No files matched your search

+17 -20
View File
@@ -67,10 +67,10 @@ public class Client extends SimProcess {
passivate();// czeka az kasjerka bedzie dostepna,
// kasjerka
// sama wyciaga go z kolejki
if (hasMeal) {// czy dosotal jedzenie
if (model.getAvailableSeats() <= 0) { //jezeli jest brak siedzen klient oczekuje w kolejce na wolne siedzenie
addWaitingForTableQueue();
System.out.println("gdfg");
passivate(); // czeaka az zwolnia sie miejsca w
// stolowce
@@ -78,20 +78,13 @@ public class Client extends SimProcess {
// zajmuje miejsce przy stoliku
for (Table table : model.getTables()) {
if (table.getEmpySeatCount()>0) {
if(this.table==null)
this.table=table;
if(clientCharacter>=1.5){//jezeli klient jest śmialy/pewny siebie szuka takiego stoloki do ktorego moze sie przysisc
if(table.getClientCount()>0)
{
this.table = table;
break;
}
}else
if(table.getClientCount()==0){ //klient nieśmialy wybiera jezeli to mozliwe pusty stolik
this.table = table;
break;
}
else
if (table.getEmpySeatCount()>0) {
if(this.table.getClientCount()>table.getClientCount())
this.table=table;
}
@@ -109,16 +102,20 @@ public class Client extends SimProcess {
client.activate();
}
} else
} else{
Canteen.clientLeftOnInitCount++;
} else
System.out.println("Nie ma dla mnie jedzenia");
}
} else{
Canteen.clientLeftOnInitCount++;
} else
System.out.println("Brak miejsca");}
} else{
Canteen.clientLeftOnInitCount++;
} else
System.out.println("Za dluga kolejka ");}
} else{
Canteen.clientLeftOnInitCount++;
}
System.out.println("Grupa sie rozmysla");
}}
}
+1
View File
@@ -47,6 +47,7 @@ public class GroupGenerator extends ClientGenerator{
for (Client client : groupOfClient) {
client.setStayInCanteen(true);
client.activateAfter(this);
}
}
else{
-1
View File
@@ -34,7 +34,6 @@ public class Table {
* @param client kroty ma zamiar odejsc z stolika
*/
public void removeClient(Client client) {
if(this instanceof Table2Seats)
clientsAtTheTable.remove(client);
}