Biblioteca Java - Rev 32
Subversion Repositories:
(root)/Courses and labs samples/ISP/Exemple_ISP_Cluj_2015/ElevatorCurs/src/elevatorcurs/model/Simulator.java @ 39
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package elevatorcurs.model;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Mihai Hulea mihai.hulea@aut.utcluj.ro
*/
public class Simulator {
private Controller c;
private Elevator e;
public Simulator(Controller c, Elevator e) {
this.c = c;
this.e = e;
}
public void simulate(){
while(true){
e.move();
c.step();
System.out.println(e);
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
Logger.getLogger(Simulator.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package elevatorcurs.model;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Mihai Hulea mihai.hulea@aut.utcluj.ro
*/
public class Simulator {
private Controller c;
private Elevator e;
public Simulator(Controller c, Elevator e) {
this.c = c;
this.e = e;
}
public void simulate(){
while(true){
e.move();
c.step();
System.out.println(e);
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
Logger.getLogger(Simulator.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}