Biblioteca Java - Rev 32
Subversion Repositories:
(root)/Courses and labs samples/ISP/Exemple_ISP_Cluj_2015/ElevatorCurs/src/elevatorcurs/ElevatorCurs.java @ 35
/*
* 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;
import elevatorcurs.model.*;
/**
*
* @author Mihai Hulea mihai.hulea@aut.utcluj.ro
*/
public class ElevatorCurs {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Elevator e1 = new Elevator();
e1.setCurrentDir(Direction.UP);
System.out.println(e1);
for (int i = 0; i < 5; i++) {
e1.move();
System.out.println(e1);
}
e1.setCurrentDir(Direction.DOWN);
for (int i = 0; i < 5; i++) {
e1.move();
System.out.println(e1);
}
e1.setCurrentDir(Direction.HOLD);
for (int i = 0; i < 5; i++) {
e1.move();
System.out.println(e1);
}
///////////////
Controller c = new Controller(e1);
Simulator s = new Simulator(c, e1);
c.addJob(new Job(2));
c.addJob(new Job(1));
s.simulate();
}
}
* 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;
import elevatorcurs.model.*;
/**
*
* @author Mihai Hulea mihai.hulea@aut.utcluj.ro
*/
public class ElevatorCurs {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Elevator e1 = new Elevator();
e1.setCurrentDir(Direction.UP);
System.out.println(e1);
for (int i = 0; i < 5; i++) {
e1.move();
System.out.println(e1);
}
e1.setCurrentDir(Direction.DOWN);
for (int i = 0; i < 5; i++) {
e1.move();
System.out.println(e1);
}
e1.setCurrentDir(Direction.HOLD);
for (int i = 0; i < 5; i++) {
e1.move();
System.out.println(e1);
}
///////////////
Controller c = new Controller(e1);
Simulator s = new Simulator(c, e1);
c.addJob(new Job(2));
c.addJob(new Job(1));
s.simulate();
}
}