Biblioteca Java - Rev 32

Subversion Repositories:
Rev:
/*
 * 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);
            }
        }
    }
}