Biblioteca Java - Rev 32
Subversion Repositories:
(root)/Courses and labs samples/ISP/Exemple_ISP_Cluj_2015/ElevatorCurs/.jacocoverage/report.html/elevatorcurs.model/Simulator.java.html
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>Simulator.java</title><link rel="stylesheet" href="../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">JaCoCoverage analysis of project "ElevatorCurs" (powered by JaCoCo from EclEmma)</a> > <a href="index.source.html" class="el_package">elevatorcurs.model</a> > <span class="el_source">Simulator.java</span></div><h1>Simulator.java</h1><pre class="source lang-java linenums">/*
* 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;
<span class="nc" id="L19"> public Simulator(Controller c, Elevator e) {</span>
<span class="nc" id="L20"> this.c = c;</span>
<span class="nc" id="L21"> this.e = e;</span>
<span class="nc" id="L22"> }</span>
public void simulate(){
while(true){
<span class="nc" id="L26"> e.move();</span>
<span class="nc" id="L27"> c.step();</span>
<span class="nc" id="L28"> System.out.println(e);</span>
try {
<span class="nc" id="L31"> Thread.sleep(500);</span>
<span class="nc" id="L32"> } catch (InterruptedException ex) {</span>
<span class="nc" id="L33"> Logger.getLogger(Simulator.class.getName()).log(Level.SEVERE, null, ex);</span>
<span class="nc" id="L34"> }</span>
}
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.4.201502262128</span></div></body></html>
* 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;
<span class="nc" id="L19"> public Simulator(Controller c, Elevator e) {</span>
<span class="nc" id="L20"> this.c = c;</span>
<span class="nc" id="L21"> this.e = e;</span>
<span class="nc" id="L22"> }</span>
public void simulate(){
while(true){
<span class="nc" id="L26"> e.move();</span>
<span class="nc" id="L27"> c.step();</span>
<span class="nc" id="L28"> System.out.println(e);</span>
try {
<span class="nc" id="L31"> Thread.sleep(500);</span>
<span class="nc" id="L32"> } catch (InterruptedException ex) {</span>
<span class="nc" id="L33"> Logger.getLogger(Simulator.class.getName()).log(Level.SEVERE, null, ex);</span>
<span class="nc" id="L34"> }</span>
}
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.4.201502262128</span></div></body></html>