forked from volkhin/RoadTrafficSimulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coverage.html
358 lines (311 loc) · 206 KB
/
coverage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
[22:58:36] Requiring external module coffee-script/register
[22:58:36] Using gulpfile ~/RoadTrafficSimulator/gulpfile.coffee
[22:58:36] Starting 'coverage'...
[22:58:37] Finished 'coverage' after 706 ms
<!DOCTYPE html><html><head><title>Coverage</title><script>
headings = [];
onload = function(){
headings = document.querySelectorAll('h2');
};
onscroll = function(e){
var heading = find(window.scrollY);
if (!heading) return;
var links = document.querySelectorAll('#menu a')
, link;
for (var i = 0, len = links.length; i < len; ++i) {
link = links[i];
link.className = link.getAttribute('href') == '#' + heading.id
? 'active'
: '';
}
};
function find(y) {
var i = headings.length
, heading;
while (i--) {
heading = headings[i];
if (y >= heading.offsetTop) {
return heading;
}
}
}
</script>
<style>
body {
font: 14px/1.6 "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 0;
color: #2C2C2C;
border-top: 2px solid #ddd;
}
#coverage {
padding: 60px;
}
h1 a {
color: inherit;
font-weight: inherit;
}
h1 a:hover {
text-decoration: none;
}
.onload h1 {
opacity: 1;
}
h2 {
width: 80%;
margin-top: 80px;
margin-bottom: 0;
font-weight: 100;
letter-spacing: 1px;
border-bottom: 1px solid #eee;
}
a {
color: #8A6343;
font-weight: bold;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
ul {
margin-top: 20px;
padding: 0 15px;
width: 100%;
}
ul li {
float: left;
width: 40%;
margin-top: 5px;
margin-right: 60px;
list-style: none;
border-bottom: 1px solid #eee;
padding: 5px 0;
font-size: 12px;
}
ul::after {
content: '.';
height: 0;
display: block;
visibility: hidden;
clear: both;
}
code {
font: 12px monaco, monospace;
}
pre {
margin: 30px;
padding: 30px;
border: 1px solid #eee;
border-bottom-color: #ddd;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-box-shadow: inset 0 0 10px #eee;
-moz-box-shadow: inset 0 0 10px #eee;
box-shadow: inset 0 0 10px #eee;
overflow-x: auto;
}
img {
margin: 30px;
padding: 1px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 3px 10px #dedede, 0 1px 5px #888;
-moz-box-shadow: 0 3px 10px #dedede, 0 1px 5px #888;
box-shadow: 0 3px 10px #dedede, 0 1px 5px #888;
max-width: 100%;
}
footer {
background: #eee;
width: 100%;
padding: 50px 0;
text-align: right;
border-top: 1px solid #ddd;
}
footer span {
display: block;
margin-right: 30px;
color: #888;
font-size: 12px;
}
#menu {
position: fixed;
font-size: 12px;
overflow-y: auto;
top: 0;
right: 0;
margin: 0;
height: 100%;
padding: 15px 0;
text-align: right;
border-left: 1px solid #eee;
-moz-box-shadow: 0 0 2px #888
, inset 5px 0 20px rgba(0,0,0,.5)
, inset 5px 0 3px rgba(0,0,0,.3);
-webkit-box-shadow: 0 0 2px #888
, inset 5px 0 20px rgba(0,0,0,.5)
, inset 5px 0 3px rgba(0,0,0,.3);
box-shadow: 0 0 2px #888
, inset 5px 0 20px rgba(0,0,0,.5)
, inset 5px 0 3px rgba(0,0,0,.3);
-webkit-font-smoothing: antialiased;
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAABmCAMAAAAOARRQAAABelBMVEUjJSU6OzshIyM5OjoqKy02NjgsLS01NTYjJCUzNTUgISMlJSc0NTUvMDA6PDwlJyg1NjYoKis2NjYrLS02ODkpKyw0NDYrLC04ODovLzA4Ojo0NDUtLy86OjwjIyU4OTosLS82ODgtLS8hIyQvMTEnKCooKSsrKy0qLCwkJSUnKCkrLCwpKiwwMjIxMzMqLC0tLS0pKissLC00NTYwMDIwMTQpKysoKSovMDEtLzA2OTkxMzUrKywvLy8qKyszNTY5OzsqKiw6OjswMDExNDUoKiozNDUvMDIyNDY1Njg2Njk5OTozMzU0NjY4ODkiIyUiIyQ4OTkuMDEmKCowMjQwMTErLS4qKywwMTMhIiMpKiopKy0tLjAkJScxNDQvLzExNDYyNDQmKCk5OTslJig5OjskJSYxMzQrLS8gISIwMTIoKCk1NTUlJSUnJygwMDA4ODgiIiMhISI8PDw6Ojo5OTkpKSojIyQ7OzsyMjIpKSssLCw6Ozw1NjlrfLakAAAg2UlEQVR42jR6i3ea6rYvPgANIAhVXh8WvkQlioUiFlFcBtAmoiRNdzxqu9p0J7vrdK29zuPeex77nnvO/35n1r1ndHRktI0jTOacv/l7lCBK5UqVpOha/YxmWK7BC4TQFKVXrbYsnimqxuuMVlOQ0XltWjUdCwRJ1M+tC1KudOs9q6+da2adUewG0SC0SwELfHtgDds93VEuydEbl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v0nFvv09uDScQbjx+w4kPQjgjlW+g9ws9VEJvI2k8N6XxVu0uIwovgTFdunG24gBtaDi+y1YLQwZ8mwbip5fVlO3k0n0AEr/ETbtu8Vjkm+nNSiEb7X/3fMjBL5A8PdgG+/FnbexbFFExmEfetXAnisEKy5z44WVPpQZjSy/jzeGn4yDRsFGqhh87QPaDBWhlo37IFbe/C0xynS91d2tP/AJoJS0sVF6iwAAAAAElFTkSuQmCC");
}
#menu::after {
display: block;
content: '';
padding-top: 80px;
}
#logo {
position: fixed;
bottom: 10px;
right: 10px;
background: rgba(255,255,255,.1);
font-size: 11px;
display: block;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
-webkit-box-shadow: 0 0 3px rgba(0,0,0,.2);
-moz-box-shadow: 0 0 3px rgba(0,0,0,.2);
box-shadow: 0 0 3px rgba(0,0,0,.2);
color: inherit;
}
#menu li a {
display: block;
color: white;
padding: 0 35px 0 25px;
-webkit-transition: background 300ms;
-moz-transition: background 300ms;
}
#menu li {
position: relative;
list-style: none;
}
#menu a:hover,
#menu a.active {
text-decoration: none;
background: rgba(255,255,255,.1);
}
#menu li:hover .cov {
opacity: 1;
}
#menu li .dirname {
opacity: .60;
padding-right: 2px;
}
#menu li .basename {
opacity: 1;
}
#menu .cov {
background: rgba(0,0,0,.4);
position: absolute;
top: 0;
right: 8px;
font-size: 9px;
opacity: .6;
text-align: left;
width: 17px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding: 2px 3px;
text-align: center;
}
#stats:nth-child(2n) {
display: inline-block;
margin-top: 15px;
border: 1px solid #eee;
padding: 10px;
-webkit-box-shadow: inset 0 0 2px #eee;
-moz-box-shadow: inset 0 0 2px #eee;
box-shadow: inset 0 0 2px #eee;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
#stats div {
float: left;
padding: 0 5px;
}
#stats::after {
display: block;
content: '';
clear: both;
}
#stats .sloc::after {
content: ' SLOC';
color: #b6b6b6;
}
#stats .percentage::after {
content: ' coverage';
color: #b6b6b6;
}
#stats .hits,
#stats .misses {
display: none;
}
.high {
color: #00d4b4;
}
.medium {
color: #e87d0d;
}
.low {
color: #d4081a;
}
.terrible {
color: #d4081a;
font-weight: bold;
}
table {
width: 80%;
margin-top: 10px;
border-collapse: collapse;
border: 1px solid #cbcbcb;
color: #363636;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
table thead {
display: none;
}
table td.line,
table td.hits {
width: 20px;
background: #eaeaea;
text-align: center;
font-size: 11px;
padding: 0 10px;
color: #949494;
}
table td.hits {
width: 10px;
padding: 2px 5px;
color: rgba(0,0,0,.2);
background: #f0f0f0;
}
tr.miss td.line,
tr.miss td.hits {
background: #e6c3c7;
}
tr.miss td {
background: #f8d5d8;
}
td.source {
padding-left: 15px;
line-height: 15px;
white-space: pre;
font: 12px monaco, monospace;
}
code .comment { color: #ddd }
code .init { color: #2F6FAD }
code .string { color: #5890AD }
code .keyword { color: #8A6343 }
code .number { color: #2F6FAD }
</style></head><body><div id="coverage"><h1 id="overview">Coverage</h1><div id="menu"><li><a href="#overview">overview</a></li><li><span class="cov low">26</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/geom/curve.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/geom/</span><span class="basename">curve.coffee</span></a></li><li><span class="cov high">88</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/geom/point.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/geom/</span><span class="basename">point.coffee</span></a></li><li><span class="cov high">86</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/geom/rect.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/geom/</span><span class="basename">rect.coffee</span></a></li><li><span class="cov high">95</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/geom/segment.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/geom/</span><span class="basename">segment.coffee</span></a></li><li><span class="cov high">100</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/helpers.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/</span><span class="basename">helpers.coffee</span></a></li><li><span class="cov terrible">18</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/model/car.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/model/</span><span class="basename">car.coffee</span></a></li><li><span class="cov low">35</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/model/control-signals.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/model/</span><span class="basename">control-signals.coffee</span></a></li><li><span class="cov low">35</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/model/intersection.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/model/</span><span class="basename">intersection.coffee</span></a></li><li><span class="cov low">36</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/model/lane-position.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/model/</span><span class="basename">lane-position.coffee</span></a></li><li><span class="cov low">35</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/model/lane.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/model/</span><span class="basename">lane.coffee</span></a></li><li><span class="cov low">41</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/model/pool.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/model/</span><span class="basename">pool.coffee</span></a></li><li><span class="cov low">27</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/model/road.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/model/</span><span class="basename">road.coffee</span></a></li><li><span class="cov terrible">20</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/model/trajectory.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/model/</span><span class="basename">trajectory.coffee</span></a></li><li><span class="cov terrible">20</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/model/world.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/model/</span><span class="basename">world.coffee</span></a></li><li><span class="cov high">100</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/settings.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/</span><span class="basename">settings.coffee</span></a></li><li><span class="cov high">100</span><a href="#/home/aurelien/RoadTrafficSimulator/coffee/spec/integration-spec.coffee"><span class="dirname">/home/aurelien/RoadTrafficSimulator/coffee/spec/</span><span class="basename">integration-spec.coffee</span></a></li><a id="logo" href="http://visionmedia.github.io/mocha/">m</a></div><div id="stats" class="low"><div class="percentage">37%</div><div class="sloc">935</div><div class="hits">346</div><div class="misses">589</div></div><div id="files"><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/geom/curve.coffee">/home/aurelien/RoadTrafficSimulator/coffee/geom/curve.coffee</h2><div id="stats" class="low"><div class="percentage">26%</div><div class="sloc">46</div><div class="hits">12</div><div class="misses">34</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Curve, Segment;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> Segment = require('./segment');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> Curve = (function() {</td></tr><tr class="hit"><td class="line">10</td><td class="hits">1</td><td class="source"> function Curve(A, B, O, Q) {</td></tr><tr class="miss"><td class="line">11</td><td class="hits">0</td><td class="source"> this.A = A;</td></tr><tr class="miss"><td class="line">12</td><td class="hits">0</td><td class="source"> this.B = B;</td></tr><tr class="miss"><td class="line">13</td><td class="hits">0</td><td class="source"> this.O = O;</td></tr><tr class="miss"><td class="line">14</td><td class="hits">0</td><td class="source"> this.Q = Q;</td></tr><tr class="miss"><td class="line">15</td><td class="hits">0</td><td class="source"> this.AB = new Segment(this.A, this.B);</td></tr><tr class="miss"><td class="line">16</td><td class="hits">0</td><td class="source"> this.AO = new Segment(this.A, this.O);</td></tr><tr class="miss"><td class="line">17</td><td class="hits">0</td><td class="source"> this.OQ = new Segment(this.O, this.Q);</td></tr><tr class="miss"><td class="line">18</td><td class="hits">0</td><td class="source"> this.QB = new Segment(this.Q, this.B);</td></tr><tr class="miss"><td class="line">19</td><td class="hits">0</td><td class="source"> this._length = null;</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">21</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">22</td><td class="hits">1</td><td class="source"> Curve.property('length', {</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">24</td><td class="hits">0</td><td class="source"> var i, point, pointsNumber, prevoiusPoint, _i;</td></tr><tr class="miss"><td class="line">25</td><td class="hits">0</td><td class="source"> if (this._length == null) {</td></tr><tr class="miss"><td class="line">26</td><td class="hits">0</td><td class="source"> pointsNumber = 10;</td></tr><tr class="miss"><td class="line">27</td><td class="hits">0</td><td class="source"> prevoiusPoint = null;</td></tr><tr class="miss"><td class="line">28</td><td class="hits">0</td><td class="source"> this._length = 0;</td></tr><tr class="miss"><td class="line">29</td><td class="hits">0</td><td class="source"> for (i = _i = 0; 0 <= pointsNumber ? _i <= pointsNumber : _i >= pointsNumber; i = 0 <= pointsNumber ? ++_i : --_i) {</td></tr><tr class="miss"><td class="line">30</td><td class="hits">0</td><td class="source"> point = this.getPoint(i / pointsNumber);</td></tr><tr class="miss"><td class="line">31</td><td class="hits">0</td><td class="source"> if (prevoiusPoint) {</td></tr><tr class="miss"><td class="line">32</td><td class="hits">0</td><td class="source"> this._length += point.subtract(prevoiusPoint).length;</td></tr><tr><td class="line">33</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">34</td><td class="hits">0</td><td class="source"> prevoiusPoint = point;</td></tr><tr><td class="line">35</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">36</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">37</td><td class="hits">0</td><td class="source"> return this._length;</td></tr><tr><td class="line">38</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">39</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">41</td><td class="hits">1</td><td class="source"> Curve.prototype.getPoint = function(a) {</td></tr><tr class="miss"><td class="line">42</td><td class="hits">0</td><td class="source"> var p0, p1, p2, r0, r1;</td></tr><tr class="miss"><td class="line">43</td><td class="hits">0</td><td class="source"> p0 = this.AO.getPoint(a);</td></tr><tr class="miss"><td class="line">44</td><td class="hits">0</td><td class="source"> p1 = this.OQ.getPoint(a);</td></tr><tr class="miss"><td class="line">45</td><td class="hits">0</td><td class="source"> p2 = this.QB.getPoint(a);</td></tr><tr class="miss"><td class="line">46</td><td class="hits">0</td><td class="source"> r0 = (new Segment(p0, p1)).getPoint(a);</td></tr><tr class="miss"><td class="line">47</td><td class="hits">0</td><td class="source"> r1 = (new Segment(p1, p2)).getPoint(a);</td></tr><tr class="miss"><td class="line">48</td><td class="hits">0</td><td class="source"> return (new Segment(r0, r1)).getPoint(a);</td></tr><tr><td class="line">49</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">50</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">51</td><td class="hits">1</td><td class="source"> Curve.prototype.getDirection = function(a) {</td></tr><tr class="miss"><td class="line">52</td><td class="hits">0</td><td class="source"> var p0, p1, p2, r0, r1;</td></tr><tr class="miss"><td class="line">53</td><td class="hits">0</td><td class="source"> p0 = this.AO.getPoint(a);</td></tr><tr class="miss"><td class="line">54</td><td class="hits">0</td><td class="source"> p1 = this.OQ.getPoint(a);</td></tr><tr class="miss"><td class="line">55</td><td class="hits">0</td><td class="source"> p2 = this.QB.getPoint(a);</td></tr><tr class="miss"><td class="line">56</td><td class="hits">0</td><td class="source"> r0 = (new Segment(p0, p1)).getPoint(a);</td></tr><tr class="miss"><td class="line">57</td><td class="hits">0</td><td class="source"> r1 = (new Segment(p1, p2)).getPoint(a);</td></tr><tr class="miss"><td class="line">58</td><td class="hits">0</td><td class="source"> return (new Segment(r0, r1)).direction;</td></tr><tr><td class="line">59</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">60</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">61</td><td class="hits">1</td><td class="source"> return Curve;</td></tr><tr><td class="line">62</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">63</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">64</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">65</td><td class="hits">1</td><td class="source"> module.exports = Curve;</td></tr><tr><td class="line">66</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">67</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">68</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/geom/point.coffee">/home/aurelien/RoadTrafficSimulator/coffee/geom/point.coffee</h2><div id="stats" class="high"><div class="percentage">88%</div><div class="sloc">25</div><div class="hits">22</div><div class="misses">3</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Point, atan2, sqrt;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> sqrt = Math.sqrt, atan2 = Math.atan2;</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> Point = (function() {</td></tr><tr class="hit"><td class="line">10</td><td class="hits">1</td><td class="source"> function Point(x, y) {</td></tr><tr class="hit"><td class="line">11</td><td class="hits">119</td><td class="source"> this.x = x != null ? x : 0;</td></tr><tr class="hit"><td class="line">12</td><td class="hits">119</td><td class="source"> this.y = y != null ? y : 0;</td></tr><tr><td class="line">13</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">14</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">15</td><td class="hits">1</td><td class="source"> Point.property('length', {</td></tr><tr><td class="line">16</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">17</td><td class="hits">0</td><td class="source"> return sqrt(this.x * this.x + this.y * this.y);</td></tr><tr><td class="line">18</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">19</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">21</td><td class="hits">1</td><td class="source"> Point.property('direction', {</td></tr><tr><td class="line">22</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">23</td><td class="hits">0</td><td class="source"> return atan2(this.y, this.x);</td></tr><tr><td class="line">24</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">25</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">26</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">27</td><td class="hits">1</td><td class="source"> Point.property('normalized', {</td></tr><tr><td class="line">28</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">29</td><td class="hits">0</td><td class="source"> return new Point(this.x / this.length, this.y / this.length);</td></tr><tr><td class="line">30</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">31</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">32</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">33</td><td class="hits">1</td><td class="source"> Point.prototype.add = function(o) {</td></tr><tr class="hit"><td class="line">34</td><td class="hits">16</td><td class="source"> return new Point(this.x + o.x, this.y + o.y);</td></tr><tr><td class="line">35</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">36</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">37</td><td class="hits">1</td><td class="source"> Point.prototype.subtract = function(o) {</td></tr><tr class="hit"><td class="line">38</td><td class="hits">13</td><td class="source"> return new Point(this.x - o.x, this.y - o.y);</td></tr><tr><td class="line">39</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">41</td><td class="hits">1</td><td class="source"> Point.prototype.mult = function(k) {</td></tr><tr class="hit"><td class="line">42</td><td class="hits">16</td><td class="source"> return new Point(this.x * k, this.y * k);</td></tr><tr><td class="line">43</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">44</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">45</td><td class="hits">1</td><td class="source"> Point.prototype.divide = function(k) {</td></tr><tr class="hit"><td class="line">46</td><td class="hits">1</td><td class="source"> return new Point(this.x / k, this.y / k);</td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">48</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">49</td><td class="hits">1</td><td class="source"> return Point;</td></tr><tr><td class="line">50</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">51</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">52</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">53</td><td class="hits">1</td><td class="source"> module.exports = Point;</td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">56</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/geom/rect.coffee">/home/aurelien/RoadTrafficSimulator/coffee/geom/rect.coffee</h2><div id="stats" class="high"><div class="percentage">86%</div><div class="sloc">76</div><div class="hits">66</div><div class="misses">10</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Point, Rect, Segment, abs, _;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> abs = Math.abs;</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> _ = require('underscore');</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">11</td><td class="hits">1</td><td class="source"> Point = require('./point');</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">13</td><td class="hits">1</td><td class="source"> Segment = require('./segment');</td></tr><tr><td class="line">14</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">15</td><td class="hits">1</td><td class="source"> Rect = (function() {</td></tr><tr class="hit"><td class="line">16</td><td class="hits">1</td><td class="source"> function Rect(x, y, _width, _height) {</td></tr><tr class="hit"><td class="line">17</td><td class="hits">6</td><td class="source"> this.x = x;</td></tr><tr class="hit"><td class="line">18</td><td class="hits">6</td><td class="source"> this.y = y;</td></tr><tr class="hit"><td class="line">19</td><td class="hits">6</td><td class="source"> this._width = _width != null ? _width : 0;</td></tr><tr class="hit"><td class="line">20</td><td class="hits">6</td><td class="source"> this._height = _height != null ? _height : 0;</td></tr><tr><td class="line">21</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">22</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">23</td><td class="hits">1</td><td class="source"> Rect.copy = function(rect) {</td></tr><tr class="miss"><td class="line">24</td><td class="hits">0</td><td class="source"> return new Rect(rect.x, rect.y, rect._width, rect._height);</td></tr><tr><td class="line">25</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">26</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">27</td><td class="hits">1</td><td class="source"> Rect.prototype.toJSON = function() {</td></tr><tr class="miss"><td class="line">28</td><td class="hits">0</td><td class="source"> return _.extend({}, this);</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">30</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">31</td><td class="hits">1</td><td class="source"> Rect.prototype.area = function() {</td></tr><tr class="miss"><td class="line">32</td><td class="hits">0</td><td class="source"> return this.width() * this.height();</td></tr><tr><td class="line">33</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">34</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">35</td><td class="hits">1</td><td class="source"> Rect.prototype.left = function(left) {</td></tr><tr class="hit"><td class="line">36</td><td class="hits">20</td><td class="source"> if (left != null) {</td></tr><tr class="hit"><td class="line">37</td><td class="hits">1</td><td class="source"> this.x = left;</td></tr><tr><td class="line">38</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">39</td><td class="hits">20</td><td class="source"> return this.x;</td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">41</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">42</td><td class="hits">1</td><td class="source"> Rect.prototype.right = function(right) {</td></tr><tr class="hit"><td class="line">43</td><td class="hits">17</td><td class="source"> if (right != null) {</td></tr><tr class="miss"><td class="line">44</td><td class="hits">0</td><td class="source"> this.x = right - this.width();</td></tr><tr><td class="line">45</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">46</td><td class="hits">17</td><td class="source"> return this.x + this.width();</td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">48</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">49</td><td class="hits">1</td><td class="source"> Rect.prototype.width = function(width) {</td></tr><tr class="hit"><td class="line">50</td><td class="hits">25</td><td class="source"> if (width != null) {</td></tr><tr class="hit"><td class="line">51</td><td class="hits">1</td><td class="source"> this._width = width;</td></tr><tr><td class="line">52</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">53</td><td class="hits">25</td><td class="source"> return this._width;</td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">56</td><td class="hits">1</td><td class="source"> Rect.prototype.top = function(top) {</td></tr><tr class="hit"><td class="line">57</td><td class="hits">18</td><td class="source"> if (top != null) {</td></tr><tr class="hit"><td class="line">58</td><td class="hits">1</td><td class="source"> this.y = top;</td></tr><tr><td class="line">59</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">60</td><td class="hits">18</td><td class="source"> return this.y;</td></tr><tr><td class="line">61</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">62</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">63</td><td class="hits">1</td><td class="source"> Rect.prototype.bottom = function(bottom) {</td></tr><tr class="hit"><td class="line">64</td><td class="hits">15</td><td class="source"> if (bottom != null) {</td></tr><tr class="miss"><td class="line">65</td><td class="hits">0</td><td class="source"> this.y = bottom - this.height();</td></tr><tr><td class="line">66</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">67</td><td class="hits">15</td><td class="source"> return this.y + this.height();</td></tr><tr><td class="line">68</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">69</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">70</td><td class="hits">1</td><td class="source"> Rect.prototype.height = function(height) {</td></tr><tr class="hit"><td class="line">71</td><td class="hits">23</td><td class="source"> if (height != null) {</td></tr><tr class="hit"><td class="line">72</td><td class="hits">1</td><td class="source"> this._height = height;</td></tr><tr><td class="line">73</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">74</td><td class="hits">23</td><td class="source"> return this._height;</td></tr><tr><td class="line">75</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">76</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">77</td><td class="hits">1</td><td class="source"> Rect.prototype.center = function(center) {</td></tr><tr class="hit"><td class="line">78</td><td class="hits">5</td><td class="source"> if (center != null) {</td></tr><tr class="miss"><td class="line">79</td><td class="hits">0</td><td class="source"> this.x = center.x - this.width() / 2;</td></tr><tr class="miss"><td class="line">80</td><td class="hits">0</td><td class="source"> this.y = center.y - this.height() / 2;</td></tr><tr><td class="line">81</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">82</td><td class="hits">5</td><td class="source"> return new Point(this.x + this.width() / 2, this.y + this.height() / 2);</td></tr><tr><td class="line">83</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">84</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">85</td><td class="hits">1</td><td class="source"> Rect.prototype.containsPoint = function(point) {</td></tr><tr class="hit"><td class="line">86</td><td class="hits">7</td><td class="source"> var _ref, _ref1;</td></tr><tr class="hit"><td class="line">87</td><td class="hits">7</td><td class="source"> return (this.left() <= (_ref = point.x) && _ref <= this.right()) && (this.top() <= (_ref1 = point.y) && _ref1 <= this.bottom());</td></tr><tr><td class="line">88</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">89</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">90</td><td class="hits">1</td><td class="source"> Rect.prototype.containsRect = function(rect) {</td></tr><tr class="miss"><td class="line">91</td><td class="hits">0</td><td class="source"> return this.left() <= rect.left() && rect.right() <= this.right() && this.top() <= rect.top() && rect.bottom() <= this.bottom();</td></tr><tr><td class="line">92</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">93</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">94</td><td class="hits">1</td><td class="source"> Rect.prototype.getVertices = function() {</td></tr><tr class="hit"><td class="line">95</td><td class="hits">5</td><td class="source"> return [new Point(this.left(), this.top()), new Point(this.right(), this.top()), new Point(this.right(), this.bottom()), new Point(this.left(), this.bottom())];</td></tr><tr><td class="line">96</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">97</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">98</td><td class="hits">1</td><td class="source"> Rect.prototype.getSide = function(i) {</td></tr><tr class="hit"><td class="line">99</td><td class="hits">4</td><td class="source"> var vertices;</td></tr><tr class="hit"><td class="line">100</td><td class="hits">4</td><td class="source"> vertices = this.getVertices();</td></tr><tr class="hit"><td class="line">101</td><td class="hits">4</td><td class="source"> return new Segment(vertices[i], vertices[(i + 1) % 4]);</td></tr><tr><td class="line">102</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">103</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">104</td><td class="hits">1</td><td class="source"> Rect.prototype.getSectorId = function(point) {</td></tr><tr class="hit"><td class="line">105</td><td class="hits">4</td><td class="source"> var offset;</td></tr><tr class="hit"><td class="line">106</td><td class="hits">4</td><td class="source"> offset = point.subtract(this.center());</td></tr><tr class="hit"><td class="line">107</td><td class="hits">4</td><td class="source"> if (offset.y <= 0 && abs(offset.x) <= abs(offset.y)) {</td></tr><tr class="hit"><td class="line">108</td><td class="hits">1</td><td class="source"> return 0;</td></tr><tr><td class="line">109</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">110</td><td class="hits">3</td><td class="source"> if (offset.x >= 0 && abs(offset.x) >= abs(offset.y)) {</td></tr><tr class="hit"><td class="line">111</td><td class="hits">1</td><td class="source"> return 1;</td></tr><tr><td class="line">112</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">113</td><td class="hits">2</td><td class="source"> if (offset.y >= 0 && abs(offset.x) <= abs(offset.y)) {</td></tr><tr class="hit"><td class="line">114</td><td class="hits">1</td><td class="source"> return 2;</td></tr><tr><td class="line">115</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">116</td><td class="hits">1</td><td class="source"> if (offset.x <= 0 && abs(offset.x) >= abs(offset.y)) {</td></tr><tr class="hit"><td class="line">117</td><td class="hits">1</td><td class="source"> return 3;</td></tr><tr><td class="line">118</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">119</td><td class="hits">0</td><td class="source"> throw Error('algorithm error');</td></tr><tr><td class="line">120</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">121</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">122</td><td class="hits">1</td><td class="source"> Rect.prototype.getSector = function(point) {</td></tr><tr class="miss"><td class="line">123</td><td class="hits">0</td><td class="source"> return this.getSide(this.getSectorId(point));</td></tr><tr><td class="line">124</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">125</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">126</td><td class="hits">1</td><td class="source"> return Rect;</td></tr><tr><td class="line">127</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">128</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">129</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">130</td><td class="hits">1</td><td class="source"> module.exports = Rect;</td></tr><tr><td class="line">131</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">132</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">133</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/geom/segment.coffee">/home/aurelien/RoadTrafficSimulator/coffee/geom/segment.coffee</h2><div id="stats" class="high"><div class="percentage">95%</div><div class="sloc">40</div><div class="hits">38</div><div class="misses">2</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Segment;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> Segment = (function() {</td></tr><tr class="hit"><td class="line">8</td><td class="hits">1</td><td class="source"> function Segment(source, target) {</td></tr><tr class="hit"><td class="line">9</td><td class="hits">23</td><td class="source"> this.source = source;</td></tr><tr class="hit"><td class="line">10</td><td class="hits">23</td><td class="source"> this.target = target;</td></tr><tr><td class="line">11</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">13</td><td class="hits">1</td><td class="source"> Segment.property('vector', {</td></tr><tr><td class="line">14</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="hit"><td class="line">15</td><td class="hits">8</td><td class="source"> return this.target.subtract(this.source);</td></tr><tr><td class="line">16</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">17</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">18</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">19</td><td class="hits">1</td><td class="source"> Segment.property('length', {</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">21</td><td class="hits">0</td><td class="source"> return this.vector.length;</td></tr><tr><td class="line">22</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">24</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">25</td><td class="hits">1</td><td class="source"> Segment.property('direction', {</td></tr><tr><td class="line">26</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">27</td><td class="hits">0</td><td class="source"> return this.vector.direction;</td></tr><tr><td class="line">28</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">30</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">31</td><td class="hits">1</td><td class="source"> Segment.property('center', {</td></tr><tr><td class="line">32</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="hit"><td class="line">33</td><td class="hits">1</td><td class="source"> return this.getPoint(0.5);</td></tr><tr><td class="line">34</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">35</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">36</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">37</td><td class="hits">1</td><td class="source"> Segment.prototype.split = function(n, reverse) {</td></tr><tr class="hit"><td class="line">38</td><td class="hits">2</td><td class="source"> var k, order, _i, _j, _k, _len, _ref, _ref1, _results, _results1, _results2;</td></tr><tr class="hit"><td class="line">39</td><td class="hits">2</td><td class="source"> order = reverse ? (function() {</td></tr><tr class="hit"><td class="line">40</td><td class="hits">1</td><td class="source"> _results = [];</td></tr><tr class="hit"><td class="line">41</td><td class="hits">4</td><td class="source"> for (var _i = _ref = n - 1; _ref <= 0 ? _i <= 0 : _i >= 0; _ref <= 0 ? _i++ : _i--){ _results.push(_i); }</td></tr><tr class="hit"><td class="line">42</td><td class="hits">1</td><td class="source"> return _results;</td></tr><tr><td class="line">43</td><td class="hits"></td><td class="source"> }).apply(this) : (function() {</td></tr><tr class="hit"><td class="line">44</td><td class="hits">1</td><td class="source"> _results1 = [];</td></tr><tr class="hit"><td class="line">45</td><td class="hits">4</td><td class="source"> for (var _j = 0, _ref1 = n - 1; 0 <= _ref1 ? _j <= _ref1 : _j >= _ref1; 0 <= _ref1 ? _j++ : _j--){ _results1.push(_j); }</td></tr><tr class="hit"><td class="line">46</td><td class="hits">1</td><td class="source"> return _results1;</td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> }).apply(this);</td></tr><tr class="hit"><td class="line">48</td><td class="hits">2</td><td class="source"> _results2 = [];</td></tr><tr class="hit"><td class="line">49</td><td class="hits">2</td><td class="source"> for (_k = 0, _len = order.length; _k < _len; _k++) {</td></tr><tr class="hit"><td class="line">50</td><td class="hits">6</td><td class="source"> k = order[_k];</td></tr><tr class="hit"><td class="line">51</td><td class="hits">6</td><td class="source"> _results2.push(this.subsegment(k / n, (k + 1) / n));</td></tr><tr><td class="line">52</td><td class="hits"></td><td class="source"> }</td></tr><tr class="hit"><td class="line">53</td><td class="hits">2</td><td class="source"> return _results2;</td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">56</td><td class="hits">1</td><td class="source"> Segment.prototype.getPoint = function(a) {</td></tr><tr class="hit"><td class="line">57</td><td class="hits">1</td><td class="source"> return this.source.add(this.vector.mult(a));</td></tr><tr><td class="line">58</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">59</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">60</td><td class="hits">1</td><td class="source"> Segment.prototype.subsegment = function(a, b) {</td></tr><tr class="hit"><td class="line">61</td><td class="hits">7</td><td class="source"> var end, offset, start;</td></tr><tr class="hit"><td class="line">62</td><td class="hits">7</td><td class="source"> offset = this.vector;</td></tr><tr class="hit"><td class="line">63</td><td class="hits">7</td><td class="source"> start = this.source.add(offset.mult(a));</td></tr><tr class="hit"><td class="line">64</td><td class="hits">7</td><td class="source"> end = this.source.add(offset.mult(b));</td></tr><tr class="hit"><td class="line">65</td><td class="hits">7</td><td class="source"> return new Segment(start, end);</td></tr><tr><td class="line">66</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">67</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">68</td><td class="hits">1</td><td class="source"> return Segment;</td></tr><tr><td class="line">69</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">70</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">71</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">72</td><td class="hits">1</td><td class="source"> module.exports = Segment;</td></tr><tr><td class="line">73</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">74</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">75</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/helpers.coffee">/home/aurelien/RoadTrafficSimulator/coffee/helpers.coffee</h2><div id="stats" class="high"><div class="percentage">100%</div><div class="sloc">5</div><div class="hits">5</div><div class="misses">0</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> module.exports = {};</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> Function.prototype.property = function(prop, desc) {</td></tr><tr class="hit"><td class="line">6</td><td class="hits">36</td><td class="source"> return Object.defineProperty(this.prototype, prop, desc);</td></tr><tr><td class="line">7</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">9</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/model/car.coffee">/home/aurelien/RoadTrafficSimulator/coffee/model/car.coffee</h2><div id="stats" class="terrible"><div class="percentage">18%</div><div class="sloc">108</div><div class="hits">20</div><div class="misses">88</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Car, Trajectory, max, min, random, sqrt, _;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> max = Math.max, min = Math.min, random = Math.random, sqrt = Math.sqrt;</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> _ = require('underscore');</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">11</td><td class="hits">1</td><td class="source"> Trajectory = require('./trajectory');</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">13</td><td class="hits">1</td><td class="source"> Car = (function() {</td></tr><tr class="hit"><td class="line">14</td><td class="hits">1</td><td class="source"> function Car(lane, position) {</td></tr><tr class="miss"><td class="line">15</td><td class="hits">0</td><td class="source"> this.id = _.uniqueId('car');</td></tr><tr class="miss"><td class="line">16</td><td class="hits">0</td><td class="source"> this.color = (300 + 240 * random() | 0) % 360;</td></tr><tr class="miss"><td class="line">17</td><td class="hits">0</td><td class="source"> this._speed = 0;</td></tr><tr class="miss"><td class="line">18</td><td class="hits">0</td><td class="source"> this.width = 1.7;</td></tr><tr class="miss"><td class="line">19</td><td class="hits">0</td><td class="source"> this.length = 3 + 2 * random();</td></tr><tr class="miss"><td class="line">20</td><td class="hits">0</td><td class="source"> this.maxSpeed = 30;</td></tr><tr class="miss"><td class="line">21</td><td class="hits">0</td><td class="source"> this.s0 = 2;</td></tr><tr class="miss"><td class="line">22</td><td class="hits">0</td><td class="source"> this.timeHeadway = 1.5;</td></tr><tr class="miss"><td class="line">23</td><td class="hits">0</td><td class="source"> this.maxAcceleration = 1;</td></tr><tr class="miss"><td class="line">24</td><td class="hits">0</td><td class="source"> this.maxDeceleration = 3;</td></tr><tr class="miss"><td class="line">25</td><td class="hits">0</td><td class="source"> this.trajectory = new Trajectory(this, lane, position);</td></tr><tr class="miss"><td class="line">26</td><td class="hits">0</td><td class="source"> this.alive = true;</td></tr><tr class="miss"><td class="line">27</td><td class="hits">0</td><td class="source"> this.preferedLane = null;</td></tr><tr><td class="line">28</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">30</td><td class="hits">1</td><td class="source"> Car.property('coords', {</td></tr><tr><td class="line">31</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">32</td><td class="hits">0</td><td class="source"> return this.trajectory.coords;</td></tr><tr><td class="line">33</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">34</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">35</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">36</td><td class="hits">1</td><td class="source"> Car.property('speed', {</td></tr><tr><td class="line">37</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">38</td><td class="hits">0</td><td class="source"> return this._speed;</td></tr><tr><td class="line">39</td><td class="hits"></td><td class="source"> },</td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> set: function(speed) {</td></tr><tr class="miss"><td class="line">41</td><td class="hits">0</td><td class="source"> if (speed < 0) {</td></tr><tr class="miss"><td class="line">42</td><td class="hits">0</td><td class="source"> speed = 0;</td></tr><tr><td class="line">43</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">44</td><td class="hits">0</td><td class="source"> if (speed > this.maxSpeed) {</td></tr><tr class="miss"><td class="line">45</td><td class="hits">0</td><td class="source"> speed = this.maxSpeed;</td></tr><tr><td class="line">46</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">47</td><td class="hits">0</td><td class="source"> return this._speed = speed;</td></tr><tr><td class="line">48</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">49</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">50</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">51</td><td class="hits">1</td><td class="source"> Car.property('direction', {</td></tr><tr><td class="line">52</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">53</td><td class="hits">0</td><td class="source"> return this.trajectory.direction;</td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">56</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">57</td><td class="hits">1</td><td class="source"> Car.prototype.release = function() {</td></tr><tr class="miss"><td class="line">58</td><td class="hits">0</td><td class="source"> return this.trajectory.release();</td></tr><tr><td class="line">59</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">60</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">61</td><td class="hits">1</td><td class="source"> Car.prototype.getAcceleration = function() {</td></tr><tr class="miss"><td class="line">62</td><td class="hits">0</td><td class="source"> var a, b, breakGap, busyRoadCoeff, coeff, deltaSpeed, distanceGap, distanceToNextCar, freeRoadCoeff, intersectionCoeff, nextCarDistance, safeDistance, safeIntersectionDistance, timeGap, _ref;</td></tr><tr class="miss"><td class="line">63</td><td class="hits">0</td><td class="source"> nextCarDistance = this.trajectory.nextCarDistance;</td></tr><tr class="miss"><td class="line">64</td><td class="hits">0</td><td class="source"> distanceToNextCar = max(nextCarDistance.distance, 0);</td></tr><tr class="miss"><td class="line">65</td><td class="hits">0</td><td class="source"> a = this.maxAcceleration;</td></tr><tr class="miss"><td class="line">66</td><td class="hits">0</td><td class="source"> b = this.maxDeceleration;</td></tr><tr class="miss"><td class="line">67</td><td class="hits">0</td><td class="source"> deltaSpeed = (this.speed - ((_ref = nextCarDistance.car) != null ? _ref.speed : void 0)) || 0;</td></tr><tr class="miss"><td class="line">68</td><td class="hits">0</td><td class="source"> freeRoadCoeff = Math.pow(this.speed / this.maxSpeed, 4);</td></tr><tr class="miss"><td class="line">69</td><td class="hits">0</td><td class="source"> distanceGap = this.s0;</td></tr><tr class="miss"><td class="line">70</td><td class="hits">0</td><td class="source"> timeGap = this.speed * this.timeHeadway;</td></tr><tr class="miss"><td class="line">71</td><td class="hits">0</td><td class="source"> breakGap = this.speed * deltaSpeed / (2 * sqrt(a * b));</td></tr><tr class="miss"><td class="line">72</td><td class="hits">0</td><td class="source"> safeDistance = distanceGap + timeGap + breakGap;</td></tr><tr class="miss"><td class="line">73</td><td class="hits">0</td><td class="source"> busyRoadCoeff = Math.pow(safeDistance / distanceToNextCar, 2);</td></tr><tr class="miss"><td class="line">74</td><td class="hits">0</td><td class="source"> safeIntersectionDistance = 1 + timeGap + Math.pow(this.speed, 2) / (2 * b);</td></tr><tr class="miss"><td class="line">75</td><td class="hits">0</td><td class="source"> intersectionCoeff = Math.pow(safeIntersectionDistance / this.trajectory.distanceToStopLine, 2);</td></tr><tr class="miss"><td class="line">76</td><td class="hits">0</td><td class="source"> coeff = 1 - freeRoadCoeff - busyRoadCoeff - intersectionCoeff;</td></tr><tr class="miss"><td class="line">77</td><td class="hits">0</td><td class="source"> return this.maxAcceleration * coeff;</td></tr><tr><td class="line">78</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">79</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">80</td><td class="hits">1</td><td class="source"> Car.prototype.move = function(delta) {</td></tr><tr class="miss"><td class="line">81</td><td class="hits">0</td><td class="source"> var acceleration, currentLane, preferedLane, step, turnNumber;</td></tr><tr class="miss"><td class="line">82</td><td class="hits">0</td><td class="source"> acceleration = this.getAcceleration();</td></tr><tr class="miss"><td class="line">83</td><td class="hits">0</td><td class="source"> this.speed += acceleration * delta;</td></tr><tr class="miss"><td class="line">84</td><td class="hits">0</td><td class="source"> if (!this.trajectory.isChangingLanes && this.nextLane) {</td></tr><tr class="miss"><td class="line">85</td><td class="hits">0</td><td class="source"> currentLane = this.trajectory.current.lane;</td></tr><tr class="miss"><td class="line">86</td><td class="hits">0</td><td class="source"> turnNumber = currentLane.getTurnDirection(this.nextLane);</td></tr><tr class="miss"><td class="line">87</td><td class="hits">0</td><td class="source"> preferedLane = (function() {</td></tr><tr class="miss"><td class="line">88</td><td class="hits">0</td><td class="source"> switch (turnNumber) {</td></tr><tr><td class="line">89</td><td class="hits"></td><td class="source"> case 0:</td></tr><tr class="miss"><td class="line">90</td><td class="hits">0</td><td class="source"> return currentLane.leftmostAdjacent;</td></tr><tr><td class="line">91</td><td class="hits"></td><td class="source"> case 2:</td></tr><tr class="miss"><td class="line">92</td><td class="hits">0</td><td class="source"> return currentLane.rightmostAdjacent;</td></tr><tr><td class="line">93</td><td class="hits"></td><td class="source"> default:</td></tr><tr class="miss"><td class="line">94</td><td class="hits">0</td><td class="source"> return currentLane;</td></tr><tr><td class="line">95</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">96</td><td class="hits"></td><td class="source"> })();</td></tr><tr class="miss"><td class="line">97</td><td class="hits">0</td><td class="source"> if (preferedLane !== currentLane) {</td></tr><tr class="miss"><td class="line">98</td><td class="hits">0</td><td class="source"> this.trajectory.changeLane(preferedLane);</td></tr><tr><td class="line">99</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">100</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">101</td><td class="hits">0</td><td class="source"> step = this.speed * delta + 0.5 * acceleration * Math.pow(delta, 2);</td></tr><tr class="miss"><td class="line">102</td><td class="hits">0</td><td class="source"> if (this.trajectory.nextCarDistance.distance < step) {</td></tr><tr class="miss"><td class="line">103</td><td class="hits">0</td><td class="source"> console.log('bad IDM');</td></tr><tr><td class="line">104</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">105</td><td class="hits">0</td><td class="source"> if (this.trajectory.timeToMakeTurn(step)) {</td></tr><tr class="miss"><td class="line">106</td><td class="hits">0</td><td class="source"> if (this.nextLane == null) {</td></tr><tr class="miss"><td class="line">107</td><td class="hits">0</td><td class="source"> return this.alive = false;</td></tr><tr><td class="line">108</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">109</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">110</td><td class="hits">0</td><td class="source"> return this.trajectory.moveForward(step);</td></tr><tr><td class="line">111</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">112</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">113</td><td class="hits">1</td><td class="source"> Car.prototype.pickNextRoad = function() {</td></tr><tr class="miss"><td class="line">114</td><td class="hits">0</td><td class="source"> var currentLane, intersection, nextRoad, possibleRoads;</td></tr><tr class="miss"><td class="line">115</td><td class="hits">0</td><td class="source"> intersection = this.trajectory.nextIntersection;</td></tr><tr class="miss"><td class="line">116</td><td class="hits">0</td><td class="source"> currentLane = this.trajectory.current.lane;</td></tr><tr class="miss"><td class="line">117</td><td class="hits">0</td><td class="source"> possibleRoads = intersection.roads.filter(function(x) {</td></tr><tr class="miss"><td class="line">118</td><td class="hits">0</td><td class="source"> return x.target !== currentLane.road.source;</td></tr><tr><td class="line">119</td><td class="hits"></td><td class="source"> });</td></tr><tr class="miss"><td class="line">120</td><td class="hits">0</td><td class="source"> if (possibleRoads.length === 0) {</td></tr><tr class="miss"><td class="line">121</td><td class="hits">0</td><td class="source"> return null;</td></tr><tr><td class="line">122</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">123</td><td class="hits">0</td><td class="source"> return nextRoad = _.sample(possibleRoads);</td></tr><tr><td class="line">124</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">125</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">126</td><td class="hits">1</td><td class="source"> Car.prototype.pickNextLane = function() {</td></tr><tr class="miss"><td class="line">127</td><td class="hits">0</td><td class="source"> var laneNumber, nextRoad, turnNumber;</td></tr><tr class="miss"><td class="line">128</td><td class="hits">0</td><td class="source"> if (this.nextLane) {</td></tr><tr class="miss"><td class="line">129</td><td class="hits">0</td><td class="source"> throw Error('next lane is already chosen');</td></tr><tr><td class="line">130</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">131</td><td class="hits">0</td><td class="source"> this.nextLane = null;</td></tr><tr class="miss"><td class="line">132</td><td class="hits">0</td><td class="source"> nextRoad = this.pickNextRoad();</td></tr><tr class="miss"><td class="line">133</td><td class="hits">0</td><td class="source"> if (!nextRoad) {</td></tr><tr class="miss"><td class="line">134</td><td class="hits">0</td><td class="source"> return null;</td></tr><tr><td class="line">135</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">136</td><td class="hits">0</td><td class="source"> turnNumber = this.trajectory.current.lane.road.getTurnDirection(nextRoad);</td></tr><tr class="miss"><td class="line">137</td><td class="hits">0</td><td class="source"> laneNumber = (function() {</td></tr><tr class="miss"><td class="line">138</td><td class="hits">0</td><td class="source"> switch (turnNumber) {</td></tr><tr><td class="line">139</td><td class="hits"></td><td class="source"> case 0:</td></tr><tr class="miss"><td class="line">140</td><td class="hits">0</td><td class="source"> return nextRoad.lanesNumber - 1;</td></tr><tr><td class="line">141</td><td class="hits"></td><td class="source"> case 1:</td></tr><tr class="miss"><td class="line">142</td><td class="hits">0</td><td class="source"> return _.random(0, nextRoad.lanesNumber - 1);</td></tr><tr><td class="line">143</td><td class="hits"></td><td class="source"> case 2:</td></tr><tr class="miss"><td class="line">144</td><td class="hits">0</td><td class="source"> return 0;</td></tr><tr><td class="line">145</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">146</td><td class="hits"></td><td class="source"> })();</td></tr><tr class="miss"><td class="line">147</td><td class="hits">0</td><td class="source"> this.nextLane = nextRoad.lanes[laneNumber];</td></tr><tr class="miss"><td class="line">148</td><td class="hits">0</td><td class="source"> if (!this.nextLane) {</td></tr><tr class="miss"><td class="line">149</td><td class="hits">0</td><td class="source"> throw Error('can not pick next lane');</td></tr><tr><td class="line">150</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">151</td><td class="hits">0</td><td class="source"> return this.nextLane;</td></tr><tr><td class="line">152</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">153</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">154</td><td class="hits">1</td><td class="source"> Car.prototype.popNextLane = function() {</td></tr><tr class="miss"><td class="line">155</td><td class="hits">0</td><td class="source"> var nextLane;</td></tr><tr class="miss"><td class="line">156</td><td class="hits">0</td><td class="source"> nextLane = this.nextLane;</td></tr><tr class="miss"><td class="line">157</td><td class="hits">0</td><td class="source"> this.nextLane = null;</td></tr><tr class="miss"><td class="line">158</td><td class="hits">0</td><td class="source"> this.preferedLane = null;</td></tr><tr class="miss"><td class="line">159</td><td class="hits">0</td><td class="source"> return nextLane;</td></tr><tr><td class="line">160</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">161</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">162</td><td class="hits">1</td><td class="source"> return Car;</td></tr><tr><td class="line">163</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">164</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">165</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">166</td><td class="hits">1</td><td class="source"> module.exports = Car;</td></tr><tr><td class="line">167</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">168</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">169</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/model/control-signals.coffee">/home/aurelien/RoadTrafficSimulator/coffee/model/control-signals.coffee</h2><div id="stats" class="low"><div class="percentage">35%</div><div class="sloc">48</div><div class="hits">17</div><div class="misses">31</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var ControlSignals, random, settings,</td></tr><tr class="miss"><td class="line">4</td><td class="hits">0</td><td class="source"> __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },</td></tr><tr class="miss"><td class="line">5</td><td class="hits">0</td><td class="source"> __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> random = Math.random;</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">11</td><td class="hits">1</td><td class="source"> settings = require('../settings');</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">13</td><td class="hits">1</td><td class="source"> ControlSignals = (function() {</td></tr><tr class="hit"><td class="line">14</td><td class="hits">1</td><td class="source"> function ControlSignals(intersection) {</td></tr><tr class="miss"><td class="line">15</td><td class="hits">0</td><td class="source"> this.intersection = intersection;</td></tr><tr class="miss"><td class="line">16</td><td class="hits">0</td><td class="source"> this.onTick = __bind(this.onTick, this);</td></tr><tr class="miss"><td class="line">17</td><td class="hits">0</td><td class="source"> this.time = 0;</td></tr><tr class="miss"><td class="line">18</td><td class="hits">0</td><td class="source"> this.flipMultiplier = 1 + (random() * 0.4 - 0.2);</td></tr><tr class="miss"><td class="line">19</td><td class="hits">0</td><td class="source"> this.stateNum = 0;</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">21</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">22</td><td class="hits">1</td><td class="source"> ControlSignals.prototype.states = [['L', '', 'L', ''], ['FR', '', 'FR', ''], ['', 'L', '', 'L'], ['', 'FR', '', 'FR']];</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">24</td><td class="hits">1</td><td class="source"> ControlSignals.STATE = [</td></tr><tr><td class="line">25</td><td class="hits"></td><td class="source"> {</td></tr><tr><td class="line">26</td><td class="hits"></td><td class="source"> RED: 0,</td></tr><tr><td class="line">27</td><td class="hits"></td><td class="source"> GREEN: 1</td></tr><tr><td class="line">28</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source"> ];</td></tr><tr><td class="line">30</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">31</td><td class="hits">1</td><td class="source"> ControlSignals.property('flipInterval', {</td></tr><tr><td class="line">32</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">33</td><td class="hits">0</td><td class="source"> return this.flipMultiplier * settings.lightsFlipInterval;</td></tr><tr><td class="line">34</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">35</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">36</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">37</td><td class="hits">1</td><td class="source"> ControlSignals.prototype._decode = function(str) {</td></tr><tr class="miss"><td class="line">38</td><td class="hits">0</td><td class="source"> var state;</td></tr><tr class="miss"><td class="line">39</td><td class="hits">0</td><td class="source"> state = [0, 0, 0];</td></tr><tr class="miss"><td class="line">40</td><td class="hits">0</td><td class="source"> if (__indexOf.call(str, 'L') >= 0) {</td></tr><tr class="miss"><td class="line">41</td><td class="hits">0</td><td class="source"> state[0] = 1;</td></tr><tr><td class="line">42</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">43</td><td class="hits">0</td><td class="source"> if (__indexOf.call(str, 'F') >= 0) {</td></tr><tr class="miss"><td class="line">44</td><td class="hits">0</td><td class="source"> state[1] = 1;</td></tr><tr><td class="line">45</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">46</td><td class="hits">0</td><td class="source"> if (__indexOf.call(str, 'R') >= 0) {</td></tr><tr class="miss"><td class="line">47</td><td class="hits">0</td><td class="source"> state[2] = 1;</td></tr><tr><td class="line">48</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">49</td><td class="hits">0</td><td class="source"> return state;</td></tr><tr><td class="line">50</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">51</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">52</td><td class="hits">1</td><td class="source"> ControlSignals.property('state', {</td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">54</td><td class="hits">0</td><td class="source"> var stringState, x, _i, _len, _results;</td></tr><tr class="miss"><td class="line">55</td><td class="hits">0</td><td class="source"> stringState = this.states[this.stateNum % this.states.length];</td></tr><tr class="miss"><td class="line">56</td><td class="hits">0</td><td class="source"> if (this.intersection.roads.length <= 2) {</td></tr><tr class="miss"><td class="line">57</td><td class="hits">0</td><td class="source"> stringState = ['LFR', 'LFR', 'LFR', 'LFR'];</td></tr><tr><td class="line">58</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">59</td><td class="hits">0</td><td class="source"> _results = [];</td></tr><tr class="miss"><td class="line">60</td><td class="hits">0</td><td class="source"> for (_i = 0, _len = stringState.length; _i < _len; _i++) {</td></tr><tr class="miss"><td class="line">61</td><td class="hits">0</td><td class="source"> x = stringState[_i];</td></tr><tr class="miss"><td class="line">62</td><td class="hits">0</td><td class="source"> _results.push(this._decode(x));</td></tr><tr><td class="line">63</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">64</td><td class="hits">0</td><td class="source"> return _results;</td></tr><tr><td class="line">65</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">66</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">67</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">68</td><td class="hits">1</td><td class="source"> ControlSignals.prototype.flip = function() {</td></tr><tr class="miss"><td class="line">69</td><td class="hits">0</td><td class="source"> return this.stateNum += 1;</td></tr><tr><td class="line">70</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">71</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">72</td><td class="hits">1</td><td class="source"> ControlSignals.prototype.onTick = function(delta) {</td></tr><tr class="miss"><td class="line">73</td><td class="hits">0</td><td class="source"> this.time += delta;</td></tr><tr class="miss"><td class="line">74</td><td class="hits">0</td><td class="source"> if (this.time > this.flipInterval) {</td></tr><tr class="miss"><td class="line">75</td><td class="hits">0</td><td class="source"> this.flip();</td></tr><tr class="miss"><td class="line">76</td><td class="hits">0</td><td class="source"> return this.time -= this.flipInterval;</td></tr><tr><td class="line">77</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">78</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">79</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">80</td><td class="hits">1</td><td class="source"> return ControlSignals;</td></tr><tr><td class="line">81</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">82</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">83</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">84</td><td class="hits">1</td><td class="source"> module.exports = ControlSignals;</td></tr><tr><td class="line">85</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">86</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">87</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/model/intersection.coffee">/home/aurelien/RoadTrafficSimulator/coffee/model/intersection.coffee</h2><div id="stats" class="low"><div class="percentage">35%</div><div class="sloc">40</div><div class="hits">14</div><div class="misses">26</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var ControlSignals, Intersection, Rect, _;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> _ = require('underscore');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> ControlSignals = require('./control-signals');</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">11</td><td class="hits">1</td><td class="source"> Rect = require('../geom/rect');</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">13</td><td class="hits">1</td><td class="source"> Intersection = (function() {</td></tr><tr class="hit"><td class="line">14</td><td class="hits">1</td><td class="source"> function Intersection(rect) {</td></tr><tr class="miss"><td class="line">15</td><td class="hits">0</td><td class="source"> this.rect = rect;</td></tr><tr class="miss"><td class="line">16</td><td class="hits">0</td><td class="source"> this.id = _.uniqueId('intersection');</td></tr><tr class="miss"><td class="line">17</td><td class="hits">0</td><td class="source"> this.roads = [];</td></tr><tr class="miss"><td class="line">18</td><td class="hits">0</td><td class="source"> this.inRoads = [];</td></tr><tr class="miss"><td class="line">19</td><td class="hits">0</td><td class="source"> this.controlSignals = new ControlSignals(this);</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">21</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">22</td><td class="hits">1</td><td class="source"> Intersection.copy = function(intersection) {</td></tr><tr class="miss"><td class="line">23</td><td class="hits">0</td><td class="source"> var result;</td></tr><tr class="miss"><td class="line">24</td><td class="hits">0</td><td class="source"> intersection.rect = Rect.copy(intersection.rect);</td></tr><tr class="miss"><td class="line">25</td><td class="hits">0</td><td class="source"> result = Object.create(Intersection.prototype);</td></tr><tr class="miss"><td class="line">26</td><td class="hits">0</td><td class="source"> _.extend(result, intersection);</td></tr><tr class="miss"><td class="line">27</td><td class="hits">0</td><td class="source"> result.roads = [];</td></tr><tr class="miss"><td class="line">28</td><td class="hits">0</td><td class="source"> result.inRoads = [];</td></tr><tr class="miss"><td class="line">29</td><td class="hits">0</td><td class="source"> result.controlSignals = new ControlSignals(result);</td></tr><tr class="miss"><td class="line">30</td><td class="hits">0</td><td class="source"> return result;</td></tr><tr><td class="line">31</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">32</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">33</td><td class="hits">1</td><td class="source"> Intersection.prototype.toJSON = function() {</td></tr><tr class="miss"><td class="line">34</td><td class="hits">0</td><td class="source"> var obj;</td></tr><tr class="miss"><td class="line">35</td><td class="hits">0</td><td class="source"> return obj = {</td></tr><tr><td class="line">36</td><td class="hits"></td><td class="source"> id: this.id,</td></tr><tr><td class="line">37</td><td class="hits"></td><td class="source"> rect: this.rect</td></tr><tr><td class="line">38</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">39</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">41</td><td class="hits">1</td><td class="source"> Intersection.prototype.update = function() {</td></tr><tr class="miss"><td class="line">42</td><td class="hits">0</td><td class="source"> var road, _i, _j, _len, _len1, _ref, _ref1, _results;</td></tr><tr class="miss"><td class="line">43</td><td class="hits">0</td><td class="source"> _ref = this.roads;</td></tr><tr class="miss"><td class="line">44</td><td class="hits">0</td><td class="source"> for (_i = 0, _len = _ref.length; _i < _len; _i++) {</td></tr><tr class="miss"><td class="line">45</td><td class="hits">0</td><td class="source"> road = _ref[_i];</td></tr><tr class="miss"><td class="line">46</td><td class="hits">0</td><td class="source"> road.update();</td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">48</td><td class="hits">0</td><td class="source"> _ref1 = this.inRoads;</td></tr><tr class="miss"><td class="line">49</td><td class="hits">0</td><td class="source"> _results = [];</td></tr><tr class="miss"><td class="line">50</td><td class="hits">0</td><td class="source"> for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {</td></tr><tr class="miss"><td class="line">51</td><td class="hits">0</td><td class="source"> road = _ref1[_j];</td></tr><tr class="miss"><td class="line">52</td><td class="hits">0</td><td class="source"> _results.push(road.update());</td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">54</td><td class="hits">0</td><td class="source"> return _results;</td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">56</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">57</td><td class="hits">1</td><td class="source"> return Intersection;</td></tr><tr><td class="line">58</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">59</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">60</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">61</td><td class="hits">1</td><td class="source"> module.exports = Intersection;</td></tr><tr><td class="line">62</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">63</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">64</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/model/lane-position.coffee">/home/aurelien/RoadTrafficSimulator/coffee/model/lane-position.coffee</h2><div id="stats" class="low"><div class="percentage">36%</div><div class="sloc">41</div><div class="hits">15</div><div class="misses">26</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var LanePosition, _;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> _ = require('underscore');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> LanePosition = (function() {</td></tr><tr class="hit"><td class="line">10</td><td class="hits">1</td><td class="source"> function LanePosition(car, lane, position) {</td></tr><tr class="miss"><td class="line">11</td><td class="hits">0</td><td class="source"> this.car = car;</td></tr><tr class="miss"><td class="line">12</td><td class="hits">0</td><td class="source"> this.position = position;</td></tr><tr class="miss"><td class="line">13</td><td class="hits">0</td><td class="source"> this.id = _.uniqueId('laneposition');</td></tr><tr class="miss"><td class="line">14</td><td class="hits">0</td><td class="source"> this.free = true;</td></tr><tr class="miss"><td class="line">15</td><td class="hits">0</td><td class="source"> this.lane = lane;</td></tr><tr><td class="line">16</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">17</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">18</td><td class="hits">1</td><td class="source"> LanePosition.property('lane', {</td></tr><tr><td class="line">19</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">20</td><td class="hits">0</td><td class="source"> return this._lane;</td></tr><tr><td class="line">21</td><td class="hits"></td><td class="source"> },</td></tr><tr><td class="line">22</td><td class="hits"></td><td class="source"> set: function(lane) {</td></tr><tr class="miss"><td class="line">23</td><td class="hits">0</td><td class="source"> this.release();</td></tr><tr class="miss"><td class="line">24</td><td class="hits">0</td><td class="source"> return this._lane = lane;</td></tr><tr><td class="line">25</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">26</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">27</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">28</td><td class="hits">1</td><td class="source"> LanePosition.property('relativePosition', {</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">30</td><td class="hits">0</td><td class="source"> return this.position / this.lane.length;</td></tr><tr><td class="line">31</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">32</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">33</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">34</td><td class="hits">1</td><td class="source"> LanePosition.prototype.acquire = function() {</td></tr><tr class="miss"><td class="line">35</td><td class="hits">0</td><td class="source"> var _ref;</td></tr><tr class="miss"><td class="line">36</td><td class="hits">0</td><td class="source"> if (((_ref = this.lane) != null ? _ref.addCarPosition : void 0) != null) {</td></tr><tr class="miss"><td class="line">37</td><td class="hits">0</td><td class="source"> this.free = false;</td></tr><tr class="miss"><td class="line">38</td><td class="hits">0</td><td class="source"> return this.lane.addCarPosition(this);</td></tr><tr><td class="line">39</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">41</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">42</td><td class="hits">1</td><td class="source"> LanePosition.prototype.release = function() {</td></tr><tr class="miss"><td class="line">43</td><td class="hits">0</td><td class="source"> var _ref;</td></tr><tr class="miss"><td class="line">44</td><td class="hits">0</td><td class="source"> if (!this.free && ((_ref = this.lane) != null ? _ref.removeCar : void 0)) {</td></tr><tr class="miss"><td class="line">45</td><td class="hits">0</td><td class="source"> this.free = true;</td></tr><tr class="miss"><td class="line">46</td><td class="hits">0</td><td class="source"> return this.lane.removeCar(this);</td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">48</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">49</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">50</td><td class="hits">1</td><td class="source"> LanePosition.prototype.getNext = function() {</td></tr><tr class="miss"><td class="line">51</td><td class="hits">0</td><td class="source"> if (this.lane && !this.free) {</td></tr><tr class="miss"><td class="line">52</td><td class="hits">0</td><td class="source"> return this.lane.getNext(this);</td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">56</td><td class="hits">1</td><td class="source"> LanePosition.property('nextCarDistance', {</td></tr><tr><td class="line">57</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">58</td><td class="hits">0</td><td class="source"> var frontPosition, next, rearPosition, result;</td></tr><tr class="miss"><td class="line">59</td><td class="hits">0</td><td class="source"> next = this.getNext();</td></tr><tr class="miss"><td class="line">60</td><td class="hits">0</td><td class="source"> if (next) {</td></tr><tr class="miss"><td class="line">61</td><td class="hits">0</td><td class="source"> rearPosition = next.position - next.car.length / 2;</td></tr><tr class="miss"><td class="line">62</td><td class="hits">0</td><td class="source"> frontPosition = this.position + this.car.length / 2;</td></tr><tr class="miss"><td class="line">63</td><td class="hits">0</td><td class="source"> return result = {</td></tr><tr><td class="line">64</td><td class="hits"></td><td class="source"> car: next.car,</td></tr><tr><td class="line">65</td><td class="hits"></td><td class="source"> distance: rearPosition - frontPosition</td></tr><tr><td class="line">66</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">67</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">68</td><td class="hits">0</td><td class="source"> return result = {</td></tr><tr><td class="line">69</td><td class="hits"></td><td class="source"> car: null,</td></tr><tr><td class="line">70</td><td class="hits"></td><td class="source"> distance: Infinity</td></tr><tr><td class="line">71</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">72</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">73</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">74</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">75</td><td class="hits">1</td><td class="source"> return LanePosition;</td></tr><tr><td class="line">76</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">77</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">78</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">79</td><td class="hits">1</td><td class="source"> module.exports = LanePosition;</td></tr><tr><td class="line">80</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">81</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">82</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/model/lane.coffee">/home/aurelien/RoadTrafficSimulator/coffee/model/lane.coffee</h2><div id="stats" class="low"><div class="percentage">35%</div><div class="sloc">68</div><div class="hits">24</div><div class="misses">44</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Lane, Segment, _;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> _ = require('underscore');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> Segment = require('../geom/segment');</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">11</td><td class="hits">1</td><td class="source"> Lane = (function() {</td></tr><tr class="hit"><td class="line">12</td><td class="hits">1</td><td class="source"> function Lane(sourceSegment, targetSegment, road) {</td></tr><tr class="miss"><td class="line">13</td><td class="hits">0</td><td class="source"> this.sourceSegment = sourceSegment;</td></tr><tr class="miss"><td class="line">14</td><td class="hits">0</td><td class="source"> this.targetSegment = targetSegment;</td></tr><tr class="miss"><td class="line">15</td><td class="hits">0</td><td class="source"> this.road = road;</td></tr><tr class="miss"><td class="line">16</td><td class="hits">0</td><td class="source"> this.leftAdjacent = null;</td></tr><tr class="miss"><td class="line">17</td><td class="hits">0</td><td class="source"> this.rightAdjacent = null;</td></tr><tr class="miss"><td class="line">18</td><td class="hits">0</td><td class="source"> this.leftmostAdjacent = null;</td></tr><tr class="miss"><td class="line">19</td><td class="hits">0</td><td class="source"> this.rightmostAdjacent = null;</td></tr><tr class="miss"><td class="line">20</td><td class="hits">0</td><td class="source"> this.carsPositions = {};</td></tr><tr class="miss"><td class="line">21</td><td class="hits">0</td><td class="source"> this.update();</td></tr><tr><td class="line">22</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">24</td><td class="hits">1</td><td class="source"> Lane.prototype.toJSON = function() {</td></tr><tr class="miss"><td class="line">25</td><td class="hits">0</td><td class="source"> var obj;</td></tr><tr class="miss"><td class="line">26</td><td class="hits">0</td><td class="source"> obj = _.extend({}, this);</td></tr><tr class="miss"><td class="line">27</td><td class="hits">0</td><td class="source"> delete obj.carsPositions;</td></tr><tr class="miss"><td class="line">28</td><td class="hits">0</td><td class="source"> return obj;</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">30</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">31</td><td class="hits">1</td><td class="source"> Lane.property('sourceSideId', {</td></tr><tr><td class="line">32</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">33</td><td class="hits">0</td><td class="source"> return this.road.sourceSideId;</td></tr><tr><td class="line">34</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">35</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">36</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">37</td><td class="hits">1</td><td class="source"> Lane.property('targetSideId', {</td></tr><tr><td class="line">38</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">39</td><td class="hits">0</td><td class="source"> return this.road.targetSideId;</td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">41</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">42</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">43</td><td class="hits">1</td><td class="source"> Lane.property('isRightmost', {</td></tr><tr><td class="line">44</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">45</td><td class="hits">0</td><td class="source"> return this === this.rightmostAdjacent;</td></tr><tr><td class="line">46</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">48</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">49</td><td class="hits">1</td><td class="source"> Lane.property('isLeftmost', {</td></tr><tr><td class="line">50</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">51</td><td class="hits">0</td><td class="source"> return this === this.leftmostAdjacent;</td></tr><tr><td class="line">52</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">55</td><td class="hits">1</td><td class="source"> Lane.property('leftBorder', {</td></tr><tr><td class="line">56</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">57</td><td class="hits">0</td><td class="source"> return new Segment(this.sourceSegment.source, this.targetSegment.target);</td></tr><tr><td class="line">58</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">59</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">60</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">61</td><td class="hits">1</td><td class="source"> Lane.property('rightBorder', {</td></tr><tr><td class="line">62</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">63</td><td class="hits">0</td><td class="source"> return new Segment(this.sourceSegment.target, this.targetSegment.source);</td></tr><tr><td class="line">64</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">65</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">66</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">67</td><td class="hits">1</td><td class="source"> Lane.prototype.update = function() {</td></tr><tr class="miss"><td class="line">68</td><td class="hits">0</td><td class="source"> this.middleLine = new Segment(this.sourceSegment.center, this.targetSegment.center);</td></tr><tr class="miss"><td class="line">69</td><td class="hits">0</td><td class="source"> this.length = this.middleLine.length;</td></tr><tr class="miss"><td class="line">70</td><td class="hits">0</td><td class="source"> return this.direction = this.middleLine.direction;</td></tr><tr><td class="line">71</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">72</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">73</td><td class="hits">1</td><td class="source"> Lane.prototype.getTurnDirection = function(other) {</td></tr><tr class="miss"><td class="line">74</td><td class="hits">0</td><td class="source"> return this.road.getTurnDirection(other.road);</td></tr><tr><td class="line">75</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">76</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">77</td><td class="hits">1</td><td class="source"> Lane.prototype.getDirection = function() {</td></tr><tr class="miss"><td class="line">78</td><td class="hits">0</td><td class="source"> return this.direction;</td></tr><tr><td class="line">79</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">80</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">81</td><td class="hits">1</td><td class="source"> Lane.prototype.getPoint = function(a) {</td></tr><tr class="miss"><td class="line">82</td><td class="hits">0</td><td class="source"> return this.middleLine.getPoint(a);</td></tr><tr><td class="line">83</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">84</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">85</td><td class="hits">1</td><td class="source"> Lane.prototype.addCarPosition = function(carPosition) {</td></tr><tr class="miss"><td class="line">86</td><td class="hits">0</td><td class="source"> if (carPosition.id in this.carsPositions) {</td></tr><tr class="miss"><td class="line">87</td><td class="hits">0</td><td class="source"> throw Error('car is already here');</td></tr><tr><td class="line">88</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">89</td><td class="hits">0</td><td class="source"> return this.carsPositions[carPosition.id] = carPosition;</td></tr><tr><td class="line">90</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">91</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">92</td><td class="hits">1</td><td class="source"> Lane.prototype.removeCar = function(carPosition) {</td></tr><tr class="miss"><td class="line">93</td><td class="hits">0</td><td class="source"> if (!(carPosition.id in this.carsPositions)) {</td></tr><tr class="miss"><td class="line">94</td><td class="hits">0</td><td class="source"> throw Error('removing unknown car');</td></tr><tr><td class="line">95</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">96</td><td class="hits">0</td><td class="source"> return delete this.carsPositions[carPosition.id];</td></tr><tr><td class="line">97</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">98</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">99</td><td class="hits">1</td><td class="source"> Lane.prototype.getNext = function(carPosition) {</td></tr><tr class="miss"><td class="line">100</td><td class="hits">0</td><td class="source"> var bestDistance, distance, id, next, o, _ref;</td></tr><tr class="miss"><td class="line">101</td><td class="hits">0</td><td class="source"> if (carPosition.lane !== this) {</td></tr><tr class="miss"><td class="line">102</td><td class="hits">0</td><td class="source"> throw Error('car is on other lane');</td></tr><tr><td class="line">103</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">104</td><td class="hits">0</td><td class="source"> next = null;</td></tr><tr class="miss"><td class="line">105</td><td class="hits">0</td><td class="source"> bestDistance = Infinity;</td></tr><tr class="miss"><td class="line">106</td><td class="hits">0</td><td class="source"> _ref = this.carsPositions;</td></tr><tr class="miss"><td class="line">107</td><td class="hits">0</td><td class="source"> for (id in _ref) {</td></tr><tr class="miss"><td class="line">108</td><td class="hits">0</td><td class="source"> o = _ref[id];</td></tr><tr class="miss"><td class="line">109</td><td class="hits">0</td><td class="source"> distance = o.position - carPosition.position;</td></tr><tr class="miss"><td class="line">110</td><td class="hits">0</td><td class="source"> if (!o.free && (0 < distance && distance < bestDistance)) {</td></tr><tr class="miss"><td class="line">111</td><td class="hits">0</td><td class="source"> bestDistance = distance;</td></tr><tr class="miss"><td class="line">112</td><td class="hits">0</td><td class="source"> next = o;</td></tr><tr><td class="line">113</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">114</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">115</td><td class="hits">0</td><td class="source"> return next;</td></tr><tr><td class="line">116</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">117</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">118</td><td class="hits">1</td><td class="source"> return Lane;</td></tr><tr><td class="line">119</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">120</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">121</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">122</td><td class="hits">1</td><td class="source"> module.exports = Lane;</td></tr><tr><td class="line">123</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">124</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">125</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/model/pool.coffee">/home/aurelien/RoadTrafficSimulator/coffee/model/pool.coffee</h2><div id="stats" class="low"><div class="percentage">41%</div><div class="sloc">36</div><div class="hits">15</div><div class="misses">21</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Pool;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> Pool = (function() {</td></tr><tr class="hit"><td class="line">8</td><td class="hits">1</td><td class="source"> function Pool(factory, pool) {</td></tr><tr class="miss"><td class="line">9</td><td class="hits">0</td><td class="source"> var k, v, _ref;</td></tr><tr class="miss"><td class="line">10</td><td class="hits">0</td><td class="source"> this.factory = factory;</td></tr><tr class="miss"><td class="line">11</td><td class="hits">0</td><td class="source"> this.objects = {};</td></tr><tr class="miss"><td class="line">12</td><td class="hits">0</td><td class="source"> if ((pool != null) && (pool.objects != null)) {</td></tr><tr class="miss"><td class="line">13</td><td class="hits">0</td><td class="source"> _ref = pool.objects;</td></tr><tr class="miss"><td class="line">14</td><td class="hits">0</td><td class="source"> for (k in _ref) {</td></tr><tr class="miss"><td class="line">15</td><td class="hits">0</td><td class="source"> v = _ref[k];</td></tr><tr class="miss"><td class="line">16</td><td class="hits">0</td><td class="source"> this.objects[k] = this.factory.copy(v);</td></tr><tr><td class="line">17</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">18</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">19</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">21</td><td class="hits">1</td><td class="source"> Pool.prototype.toJSON = function() {</td></tr><tr class="miss"><td class="line">22</td><td class="hits">0</td><td class="source"> return this.objects;</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">24</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">25</td><td class="hits">1</td><td class="source"> Pool.prototype.get = function(id) {</td></tr><tr class="miss"><td class="line">26</td><td class="hits">0</td><td class="source"> return this.objects[id];</td></tr><tr><td class="line">27</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">28</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">29</td><td class="hits">1</td><td class="source"> Pool.prototype.put = function(obj) {</td></tr><tr class="miss"><td class="line">30</td><td class="hits">0</td><td class="source"> return this.objects[obj.id] = obj;</td></tr><tr><td class="line">31</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">32</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">33</td><td class="hits">1</td><td class="source"> Pool.prototype.pop = function(obj) {</td></tr><tr class="miss"><td class="line">34</td><td class="hits">0</td><td class="source"> var id, result, _ref;</td></tr><tr class="miss"><td class="line">35</td><td class="hits">0</td><td class="source"> id = (_ref = obj.id) != null ? _ref : obj;</td></tr><tr class="miss"><td class="line">36</td><td class="hits">0</td><td class="source"> result = this.objects[id];</td></tr><tr class="miss"><td class="line">37</td><td class="hits">0</td><td class="source"> if (typeof result.release === "function") {</td></tr><tr class="miss"><td class="line">38</td><td class="hits">0</td><td class="source"> result.release();</td></tr><tr><td class="line">39</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">40</td><td class="hits">0</td><td class="source"> delete this.objects[id];</td></tr><tr class="miss"><td class="line">41</td><td class="hits">0</td><td class="source"> return result;</td></tr><tr><td class="line">42</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">43</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">44</td><td class="hits">1</td><td class="source"> Pool.prototype.all = function() {</td></tr><tr class="miss"><td class="line">45</td><td class="hits">0</td><td class="source"> return this.objects;</td></tr><tr><td class="line">46</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">48</td><td class="hits">1</td><td class="source"> Pool.prototype.clear = function() {</td></tr><tr class="miss"><td class="line">49</td><td class="hits">0</td><td class="source"> return this.objects = {};</td></tr><tr><td class="line">50</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">51</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">52</td><td class="hits">1</td><td class="source"> Pool.property('length', {</td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">54</td><td class="hits">0</td><td class="source"> return Object.keys(this.objects).length;</td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">56</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">57</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">58</td><td class="hits">1</td><td class="source"> return Pool;</td></tr><tr><td class="line">59</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">60</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">61</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">62</td><td class="hits">1</td><td class="source"> module.exports = Pool;</td></tr><tr><td class="line">63</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">64</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">65</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/model/road.coffee">/home/aurelien/RoadTrafficSimulator/coffee/model/road.coffee</h2><div id="stats" class="low"><div class="percentage">27%</div><div class="sloc">69</div><div class="hits">19</div><div class="misses">50</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Lane, Road, max, min, settings, _;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> min = Math.min, max = Math.max;</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> _ = require('underscore');</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">11</td><td class="hits">1</td><td class="source"> Lane = require('./lane');</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">13</td><td class="hits">1</td><td class="source"> settings = require('../settings');</td></tr><tr><td class="line">14</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">15</td><td class="hits">1</td><td class="source"> Road = (function() {</td></tr><tr class="hit"><td class="line">16</td><td class="hits">1</td><td class="source"> function Road(source, target) {</td></tr><tr class="miss"><td class="line">17</td><td class="hits">0</td><td class="source"> this.source = source;</td></tr><tr class="miss"><td class="line">18</td><td class="hits">0</td><td class="source"> this.target = target;</td></tr><tr class="miss"><td class="line">19</td><td class="hits">0</td><td class="source"> this.id = _.uniqueId('road');</td></tr><tr class="miss"><td class="line">20</td><td class="hits">0</td><td class="source"> this.lanes = [];</td></tr><tr class="miss"><td class="line">21</td><td class="hits">0</td><td class="source"> this.lanesNumber = null;</td></tr><tr class="miss"><td class="line">22</td><td class="hits">0</td><td class="source"> this.update();</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">24</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">25</td><td class="hits">1</td><td class="source"> Road.copy = function(road) {</td></tr><tr class="miss"><td class="line">26</td><td class="hits">0</td><td class="source"> var result;</td></tr><tr class="miss"><td class="line">27</td><td class="hits">0</td><td class="source"> result = Object.create(Road.prototype);</td></tr><tr class="miss"><td class="line">28</td><td class="hits">0</td><td class="source"> _.extend(result, road);</td></tr><tr class="miss"><td class="line">29</td><td class="hits">0</td><td class="source"> if (result.lanes == null) {</td></tr><tr class="miss"><td class="line">30</td><td class="hits">0</td><td class="source"> result.lanes = [];</td></tr><tr><td class="line">31</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">32</td><td class="hits">0</td><td class="source"> return result;</td></tr><tr><td class="line">33</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">34</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">35</td><td class="hits">1</td><td class="source"> Road.prototype.toJSON = function() {</td></tr><tr class="miss"><td class="line">36</td><td class="hits">0</td><td class="source"> var obj;</td></tr><tr class="miss"><td class="line">37</td><td class="hits">0</td><td class="source"> return obj = {</td></tr><tr><td class="line">38</td><td class="hits"></td><td class="source"> id: this.id,</td></tr><tr><td class="line">39</td><td class="hits"></td><td class="source"> source: this.source.id,</td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> target: this.target.id</td></tr><tr><td class="line">41</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">42</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">43</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">44</td><td class="hits">1</td><td class="source"> Road.property('length', {</td></tr><tr><td class="line">45</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">46</td><td class="hits">0</td><td class="source"> return this.targetSide.target.subtract(this.sourceSide.source).length;</td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">48</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">49</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">50</td><td class="hits">1</td><td class="source"> Road.property('leftmostLane', {</td></tr><tr><td class="line">51</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">52</td><td class="hits">0</td><td class="source"> return this.lanes[this.lanesNumber - 1];</td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">56</td><td class="hits">1</td><td class="source"> Road.property('rightmostLane', {</td></tr><tr><td class="line">57</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">58</td><td class="hits">0</td><td class="source"> return this.lanes[0];</td></tr><tr><td class="line">59</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">60</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">61</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">62</td><td class="hits">1</td><td class="source"> Road.prototype.getTurnDirection = function(other) {</td></tr><tr class="miss"><td class="line">63</td><td class="hits">0</td><td class="source"> var side1, side2, turnNumber;</td></tr><tr class="miss"><td class="line">64</td><td class="hits">0</td><td class="source"> if (this.target !== other.source) {</td></tr><tr class="miss"><td class="line">65</td><td class="hits">0</td><td class="source"> throw Error('invalid roads');</td></tr><tr><td class="line">66</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">67</td><td class="hits">0</td><td class="source"> side1 = this.targetSideId;</td></tr><tr class="miss"><td class="line">68</td><td class="hits">0</td><td class="source"> side2 = other.sourceSideId;</td></tr><tr class="miss"><td class="line">69</td><td class="hits">0</td><td class="source"> return turnNumber = (side2 - side1 - 1 + 8) % 4;</td></tr><tr><td class="line">70</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">71</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">72</td><td class="hits">1</td><td class="source"> Road.prototype.update = function() {</td></tr><tr class="miss"><td class="line">73</td><td class="hits">0</td><td class="source"> var i, sourceSplits, targetSplits, _base, _i, _j, _ref, _ref1, _results;</td></tr><tr class="miss"><td class="line">74</td><td class="hits">0</td><td class="source"> if (!(this.source && this.target)) {</td></tr><tr class="miss"><td class="line">75</td><td class="hits">0</td><td class="source"> throw Error('incomplete road');</td></tr><tr><td class="line">76</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">77</td><td class="hits">0</td><td class="source"> this.sourceSideId = this.source.rect.getSectorId(this.target.rect.center());</td></tr><tr class="miss"><td class="line">78</td><td class="hits">0</td><td class="source"> this.sourceSide = this.source.rect.getSide(this.sourceSideId).subsegment(0.5, 1.0);</td></tr><tr class="miss"><td class="line">79</td><td class="hits">0</td><td class="source"> this.targetSideId = this.target.rect.getSectorId(this.source.rect.center());</td></tr><tr class="miss"><td class="line">80</td><td class="hits">0</td><td class="source"> this.targetSide = this.target.rect.getSide(this.targetSideId).subsegment(0, 0.5);</td></tr><tr class="miss"><td class="line">81</td><td class="hits">0</td><td class="source"> this.lanesNumber = min(this.sourceSide.length, this.targetSide.length) | 0;</td></tr><tr class="miss"><td class="line">82</td><td class="hits">0</td><td class="source"> this.lanesNumber = max(2, this.lanesNumber / settings.gridSize | 0);</td></tr><tr class="miss"><td class="line">83</td><td class="hits">0</td><td class="source"> sourceSplits = this.sourceSide.split(this.lanesNumber, true);</td></tr><tr class="miss"><td class="line">84</td><td class="hits">0</td><td class="source"> targetSplits = this.targetSide.split(this.lanesNumber);</td></tr><tr class="miss"><td class="line">85</td><td class="hits">0</td><td class="source"> if ((this.lanes == null) || this.lanes.length < this.lanesNumber) {</td></tr><tr class="miss"><td class="line">86</td><td class="hits">0</td><td class="source"> if (this.lanes == null) {</td></tr><tr class="miss"><td class="line">87</td><td class="hits">0</td><td class="source"> this.lanes = [];</td></tr><tr><td class="line">88</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">89</td><td class="hits">0</td><td class="source"> for (i = _i = 0, _ref = this.lanesNumber - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) {</td></tr><tr class="miss"><td class="line">90</td><td class="hits">0</td><td class="source"> if ((_base = this.lanes)[i] == null) {</td></tr><tr class="miss"><td class="line">91</td><td class="hits">0</td><td class="source"> _base[i] = new Lane(sourceSplits[i], targetSplits[i], this);</td></tr><tr><td class="line">92</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">93</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">94</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">95</td><td class="hits">0</td><td class="source"> _results = [];</td></tr><tr class="miss"><td class="line">96</td><td class="hits">0</td><td class="source"> for (i = _j = 0, _ref1 = this.lanesNumber - 1; 0 <= _ref1 ? _j <= _ref1 : _j >= _ref1; i = 0 <= _ref1 ? ++_j : --_j) {</td></tr><tr class="miss"><td class="line">97</td><td class="hits">0</td><td class="source"> this.lanes[i].sourceSegment = sourceSplits[i];</td></tr><tr class="miss"><td class="line">98</td><td class="hits">0</td><td class="source"> this.lanes[i].targetSegment = targetSplits[i];</td></tr><tr class="miss"><td class="line">99</td><td class="hits">0</td><td class="source"> this.lanes[i].leftAdjacent = this.lanes[i + 1];</td></tr><tr class="miss"><td class="line">100</td><td class="hits">0</td><td class="source"> this.lanes[i].rightAdjacent = this.lanes[i - 1];</td></tr><tr class="miss"><td class="line">101</td><td class="hits">0</td><td class="source"> this.lanes[i].leftmostAdjacent = this.lanes[this.lanesNumber - 1];</td></tr><tr class="miss"><td class="line">102</td><td class="hits">0</td><td class="source"> this.lanes[i].rightmostAdjacent = this.lanes[0];</td></tr><tr class="miss"><td class="line">103</td><td class="hits">0</td><td class="source"> _results.push(this.lanes[i].update());</td></tr><tr><td class="line">104</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">105</td><td class="hits">0</td><td class="source"> return _results;</td></tr><tr><td class="line">106</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">107</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">108</td><td class="hits">1</td><td class="source"> return Road;</td></tr><tr><td class="line">109</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">110</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">111</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">112</td><td class="hits">1</td><td class="source"> module.exports = Road;</td></tr><tr><td class="line">113</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">114</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">115</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/model/trajectory.coffee">/home/aurelien/RoadTrafficSimulator/coffee/model/trajectory.coffee</h2><div id="stats" class="terrible"><div class="percentage">20%</div><div class="sloc">158</div><div class="hits">33</div><div class="misses">125</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Curve, LanePosition, Trajectory, max, min, _;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> min = Math.min, max = Math.max;</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> LanePosition = require('./lane-position');</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">11</td><td class="hits">1</td><td class="source"> Curve = require('../geom/curve');</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">13</td><td class="hits">1</td><td class="source"> _ = require('underscore');</td></tr><tr><td class="line">14</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">15</td><td class="hits">1</td><td class="source"> Trajectory = (function() {</td></tr><tr class="hit"><td class="line">16</td><td class="hits">1</td><td class="source"> function Trajectory(car, lane, position) {</td></tr><tr class="miss"><td class="line">17</td><td class="hits">0</td><td class="source"> this.car = car;</td></tr><tr class="miss"><td class="line">18</td><td class="hits">0</td><td class="source"> if (position == null) {</td></tr><tr class="miss"><td class="line">19</td><td class="hits">0</td><td class="source"> position = 0;</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">21</td><td class="hits">0</td><td class="source"> this.current = new LanePosition(this.car, lane, position);</td></tr><tr class="miss"><td class="line">22</td><td class="hits">0</td><td class="source"> this.current.acquire();</td></tr><tr class="miss"><td class="line">23</td><td class="hits">0</td><td class="source"> this.next = new LanePosition(this.car);</td></tr><tr class="miss"><td class="line">24</td><td class="hits">0</td><td class="source"> this.temp = new LanePosition(this.car);</td></tr><tr class="miss"><td class="line">25</td><td class="hits">0</td><td class="source"> this.isChangingLanes = false;</td></tr><tr><td class="line">26</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">27</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">28</td><td class="hits">1</td><td class="source"> Trajectory.property('lane', {</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">30</td><td class="hits">0</td><td class="source"> return this.temp.lane || this.current.lane;</td></tr><tr><td class="line">31</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">32</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">33</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">34</td><td class="hits">1</td><td class="source"> Trajectory.property('absolutePosition', {</td></tr><tr><td class="line">35</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">36</td><td class="hits">0</td><td class="source"> if (this.temp.lane != null) {</td></tr><tr class="miss"><td class="line">37</td><td class="hits">0</td><td class="source"> return this.temp.position;</td></tr><tr><td class="line">38</td><td class="hits"></td><td class="source"> } else {</td></tr><tr class="miss"><td class="line">39</td><td class="hits">0</td><td class="source"> return this.current.position;</td></tr><tr><td class="line">40</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">41</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">42</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">43</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">44</td><td class="hits">1</td><td class="source"> Trajectory.property('relativePosition', {</td></tr><tr><td class="line">45</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">46</td><td class="hits">0</td><td class="source"> return this.absolutePosition / this.lane.length;</td></tr><tr><td class="line">47</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">48</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">49</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">50</td><td class="hits">1</td><td class="source"> Trajectory.property('direction', {</td></tr><tr><td class="line">51</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">52</td><td class="hits">0</td><td class="source"> return this.lane.getDirection(this.relativePosition);</td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">55</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">56</td><td class="hits">1</td><td class="source"> Trajectory.property('coords', {</td></tr><tr><td class="line">57</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">58</td><td class="hits">0</td><td class="source"> return this.lane.getPoint(this.relativePosition);</td></tr><tr><td class="line">59</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">60</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">61</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">62</td><td class="hits">1</td><td class="source"> Trajectory.property('nextCarDistance', {</td></tr><tr><td class="line">63</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">64</td><td class="hits">0</td><td class="source"> var a, b;</td></tr><tr class="miss"><td class="line">65</td><td class="hits">0</td><td class="source"> a = this.current.nextCarDistance;</td></tr><tr class="miss"><td class="line">66</td><td class="hits">0</td><td class="source"> b = this.next.nextCarDistance;</td></tr><tr class="miss"><td class="line">67</td><td class="hits">0</td><td class="source"> if (a.distance < b.distance) {</td></tr><tr class="miss"><td class="line">68</td><td class="hits">0</td><td class="source"> return a;</td></tr><tr><td class="line">69</td><td class="hits"></td><td class="source"> } else {</td></tr><tr class="miss"><td class="line">70</td><td class="hits">0</td><td class="source"> return b;</td></tr><tr><td class="line">71</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">72</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">73</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">74</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">75</td><td class="hits">1</td><td class="source"> Trajectory.property('distanceToStopLine', {</td></tr><tr><td class="line">76</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">77</td><td class="hits">0</td><td class="source"> if (!this.canEnterIntersection()) {</td></tr><tr class="miss"><td class="line">78</td><td class="hits">0</td><td class="source"> return this.getDistanceToIntersection();</td></tr><tr><td class="line">79</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">80</td><td class="hits">0</td><td class="source"> return Infinity;</td></tr><tr><td class="line">81</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">82</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">83</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">84</td><td class="hits">1</td><td class="source"> Trajectory.property('nextIntersection', {</td></tr><tr><td class="line">85</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">86</td><td class="hits">0</td><td class="source"> return this.current.lane.road.target;</td></tr><tr><td class="line">87</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">88</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">89</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">90</td><td class="hits">1</td><td class="source"> Trajectory.property('previousIntersection', {</td></tr><tr><td class="line">91</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">92</td><td class="hits">0</td><td class="source"> return this.current.lane.road.source;</td></tr><tr><td class="line">93</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">94</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">95</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">96</td><td class="hits">1</td><td class="source"> Trajectory.prototype.isValidTurn = function() {</td></tr><tr class="miss"><td class="line">97</td><td class="hits">0</td><td class="source"> var nextLane, sourceLane, turnNumber;</td></tr><tr class="miss"><td class="line">98</td><td class="hits">0</td><td class="source"> nextLane = this.car.nextLane;</td></tr><tr class="miss"><td class="line">99</td><td class="hits">0</td><td class="source"> sourceLane = this.current.lane;</td></tr><tr class="miss"><td class="line">100</td><td class="hits">0</td><td class="source"> if (!nextLane) {</td></tr><tr class="miss"><td class="line">101</td><td class="hits">0</td><td class="source"> throw Error('no road to enter');</td></tr><tr><td class="line">102</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">103</td><td class="hits">0</td><td class="source"> turnNumber = sourceLane.getTurnDirection(nextLane);</td></tr><tr class="miss"><td class="line">104</td><td class="hits">0</td><td class="source"> if (turnNumber === 3) {</td></tr><tr class="miss"><td class="line">105</td><td class="hits">0</td><td class="source"> throw Error('no U-turns are allowed');</td></tr><tr><td class="line">106</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">107</td><td class="hits">0</td><td class="source"> if (turnNumber === 0 && !sourceLane.isLeftmost) {</td></tr><tr class="miss"><td class="line">108</td><td class="hits">0</td><td class="source"> throw Error('no left turns from this lane');</td></tr><tr><td class="line">109</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">110</td><td class="hits">0</td><td class="source"> if (turnNumber === 2 && !sourceLane.isRightmost) {</td></tr><tr class="miss"><td class="line">111</td><td class="hits">0</td><td class="source"> throw Error('no right turns from this lane');</td></tr><tr><td class="line">112</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">113</td><td class="hits">0</td><td class="source"> return true;</td></tr><tr><td class="line">114</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">115</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">116</td><td class="hits">1</td><td class="source"> Trajectory.prototype.canEnterIntersection = function() {</td></tr><tr class="miss"><td class="line">117</td><td class="hits">0</td><td class="source"> var intersection, nextLane, sideId, sourceLane, turnNumber;</td></tr><tr class="miss"><td class="line">118</td><td class="hits">0</td><td class="source"> nextLane = this.car.nextLane;</td></tr><tr class="miss"><td class="line">119</td><td class="hits">0</td><td class="source"> sourceLane = this.current.lane;</td></tr><tr class="miss"><td class="line">120</td><td class="hits">0</td><td class="source"> if (!nextLane) {</td></tr><tr class="miss"><td class="line">121</td><td class="hits">0</td><td class="source"> return true;</td></tr><tr><td class="line">122</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">123</td><td class="hits">0</td><td class="source"> intersection = this.nextIntersection;</td></tr><tr class="miss"><td class="line">124</td><td class="hits">0</td><td class="source"> turnNumber = sourceLane.getTurnDirection(nextLane);</td></tr><tr class="miss"><td class="line">125</td><td class="hits">0</td><td class="source"> sideId = sourceLane.road.targetSideId;</td></tr><tr class="miss"><td class="line">126</td><td class="hits">0</td><td class="source"> return intersection.controlSignals.state[sideId][turnNumber];</td></tr><tr><td class="line">127</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">128</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">129</td><td class="hits">1</td><td class="source"> Trajectory.prototype.getDistanceToIntersection = function() {</td></tr><tr class="miss"><td class="line">130</td><td class="hits">0</td><td class="source"> var distance;</td></tr><tr class="miss"><td class="line">131</td><td class="hits">0</td><td class="source"> distance = this.current.lane.length - this.car.length / 2 - this.current.position;</td></tr><tr class="miss"><td class="line">132</td><td class="hits">0</td><td class="source"> if (!this.isChangingLanes) {</td></tr><tr class="miss"><td class="line">133</td><td class="hits">0</td><td class="source"> return max(distance, 0);</td></tr><tr><td class="line">134</td><td class="hits"></td><td class="source"> } else {</td></tr><tr class="miss"><td class="line">135</td><td class="hits">0</td><td class="source"> return Infinity;</td></tr><tr><td class="line">136</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">137</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">138</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">139</td><td class="hits">1</td><td class="source"> Trajectory.prototype.timeToMakeTurn = function(plannedStep) {</td></tr><tr class="miss"><td class="line">140</td><td class="hits">0</td><td class="source"> if (plannedStep == null) {</td></tr><tr class="miss"><td class="line">141</td><td class="hits">0</td><td class="source"> plannedStep = 0;</td></tr><tr><td class="line">142</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">143</td><td class="hits">0</td><td class="source"> return this.getDistanceToIntersection() <= plannedStep;</td></tr><tr><td class="line">144</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">145</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">146</td><td class="hits">1</td><td class="source"> Trajectory.prototype.moveForward = function(distance) {</td></tr><tr class="miss"><td class="line">147</td><td class="hits">0</td><td class="source"> var gap, tempRelativePosition, _ref, _ref1;</td></tr><tr class="miss"><td class="line">148</td><td class="hits">0</td><td class="source"> distance = max(distance, 0);</td></tr><tr class="miss"><td class="line">149</td><td class="hits">0</td><td class="source"> this.current.position += distance;</td></tr><tr class="miss"><td class="line">150</td><td class="hits">0</td><td class="source"> this.next.position += distance;</td></tr><tr class="miss"><td class="line">151</td><td class="hits">0</td><td class="source"> this.temp.position += distance;</td></tr><tr class="miss"><td class="line">152</td><td class="hits">0</td><td class="source"> if (this.timeToMakeTurn() && this.canEnterIntersection() && this.isValidTurn()) {</td></tr><tr class="miss"><td class="line">153</td><td class="hits">0</td><td class="source"> this._startChangingLanes(this.car.popNextLane(), 0);</td></tr><tr><td class="line">154</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">155</td><td class="hits">0</td><td class="source"> tempRelativePosition = this.temp.position / ((_ref = this.temp.lane) != null ? _ref.length : void 0);</td></tr><tr class="miss"><td class="line">156</td><td class="hits">0</td><td class="source"> gap = 2 * this.car.length;</td></tr><tr class="miss"><td class="line">157</td><td class="hits">0</td><td class="source"> if (this.isChangingLanes && this.temp.position > gap && !this.current.free) {</td></tr><tr class="miss"><td class="line">158</td><td class="hits">0</td><td class="source"> this.current.release();</td></tr><tr><td class="line">159</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">160</td><td class="hits">0</td><td class="source"> if (this.isChangingLanes && this.next.free && this.temp.position + gap > ((_ref1 = this.temp.lane) != null ? _ref1.length : void 0)) {</td></tr><tr class="miss"><td class="line">161</td><td class="hits">0</td><td class="source"> this.next.acquire();</td></tr><tr><td class="line">162</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">163</td><td class="hits">0</td><td class="source"> if (this.isChangingLanes && tempRelativePosition >= 1) {</td></tr><tr class="miss"><td class="line">164</td><td class="hits">0</td><td class="source"> this._finishChangingLanes();</td></tr><tr><td class="line">165</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">166</td><td class="hits">0</td><td class="source"> if (this.current.lane && !this.isChangingLanes && !this.car.nextLane) {</td></tr><tr class="miss"><td class="line">167</td><td class="hits">0</td><td class="source"> return this.car.pickNextLane();</td></tr><tr><td class="line">168</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">169</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">170</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">171</td><td class="hits">1</td><td class="source"> Trajectory.prototype.changeLane = function(nextLane) {</td></tr><tr class="miss"><td class="line">172</td><td class="hits">0</td><td class="source"> var nextPosition;</td></tr><tr class="miss"><td class="line">173</td><td class="hits">0</td><td class="source"> if (this.isChangingLanes) {</td></tr><tr class="miss"><td class="line">174</td><td class="hits">0</td><td class="source"> throw Error('already changing lane');</td></tr><tr><td class="line">175</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">176</td><td class="hits">0</td><td class="source"> if (nextLane == null) {</td></tr><tr class="miss"><td class="line">177</td><td class="hits">0</td><td class="source"> throw Error('no next lane');</td></tr><tr><td class="line">178</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">179</td><td class="hits">0</td><td class="source"> if (nextLane === this.lane) {</td></tr><tr class="miss"><td class="line">180</td><td class="hits">0</td><td class="source"> throw Error('next lane == current lane');</td></tr><tr><td class="line">181</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">182</td><td class="hits">0</td><td class="source"> if (this.lane.road !== nextLane.road) {</td></tr><tr class="miss"><td class="line">183</td><td class="hits">0</td><td class="source"> throw Error('not neighbouring lanes');</td></tr><tr><td class="line">184</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">185</td><td class="hits">0</td><td class="source"> nextPosition = this.current.position + 3 * this.car.length;</td></tr><tr class="miss"><td class="line">186</td><td class="hits">0</td><td class="source"> if (!(nextPosition < this.lane.length)) {</td></tr><tr class="miss"><td class="line">187</td><td class="hits">0</td><td class="source"> throw Error('too late to change lane');</td></tr><tr><td class="line">188</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">189</td><td class="hits">0</td><td class="source"> return this._startChangingLanes(nextLane, nextPosition);</td></tr><tr><td class="line">190</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">191</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">192</td><td class="hits">1</td><td class="source"> Trajectory.prototype._getIntersectionLaneChangeCurve = function() {};</td></tr><tr><td class="line">193</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">194</td><td class="hits">1</td><td class="source"> Trajectory.prototype._getAdjacentLaneChangeCurve = function() {</td></tr><tr class="miss"><td class="line">195</td><td class="hits">0</td><td class="source"> var control1, control2, curve, direction1, direction2, distance, p1, p2;</td></tr><tr class="miss"><td class="line">196</td><td class="hits">0</td><td class="source"> p1 = this.current.lane.getPoint(this.current.relativePosition);</td></tr><tr class="miss"><td class="line">197</td><td class="hits">0</td><td class="source"> p2 = this.next.lane.getPoint(this.next.relativePosition);</td></tr><tr class="miss"><td class="line">198</td><td class="hits">0</td><td class="source"> distance = p2.subtract(p1).length;</td></tr><tr class="miss"><td class="line">199</td><td class="hits">0</td><td class="source"> direction1 = this.current.lane.middleLine.vector.normalized.mult(distance * 0.3);</td></tr><tr class="miss"><td class="line">200</td><td class="hits">0</td><td class="source"> control1 = p1.add(direction1);</td></tr><tr class="miss"><td class="line">201</td><td class="hits">0</td><td class="source"> direction2 = this.next.lane.middleLine.vector.normalized.mult(distance * 0.3);</td></tr><tr class="miss"><td class="line">202</td><td class="hits">0</td><td class="source"> control2 = p2.subtract(direction2);</td></tr><tr class="miss"><td class="line">203</td><td class="hits">0</td><td class="source"> return curve = new Curve(p1, p2, control1, control2);</td></tr><tr><td class="line">204</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">205</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">206</td><td class="hits">1</td><td class="source"> Trajectory.prototype._getCurve = function() {</td></tr><tr class="miss"><td class="line">207</td><td class="hits">0</td><td class="source"> return this._getAdjacentLaneChangeCurve();</td></tr><tr><td class="line">208</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">209</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">210</td><td class="hits">1</td><td class="source"> Trajectory.prototype._startChangingLanes = function(nextLane, nextPosition) {</td></tr><tr class="miss"><td class="line">211</td><td class="hits">0</td><td class="source"> var curve;</td></tr><tr class="miss"><td class="line">212</td><td class="hits">0</td><td class="source"> if (this.isChangingLanes) {</td></tr><tr class="miss"><td class="line">213</td><td class="hits">0</td><td class="source"> throw Error('already changing lane');</td></tr><tr><td class="line">214</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">215</td><td class="hits">0</td><td class="source"> if (nextLane == null) {</td></tr><tr class="miss"><td class="line">216</td><td class="hits">0</td><td class="source"> throw Error('no next lane');</td></tr><tr><td class="line">217</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">218</td><td class="hits">0</td><td class="source"> this.isChangingLanes = true;</td></tr><tr class="miss"><td class="line">219</td><td class="hits">0</td><td class="source"> this.next.lane = nextLane;</td></tr><tr class="miss"><td class="line">220</td><td class="hits">0</td><td class="source"> this.next.position = nextPosition;</td></tr><tr class="miss"><td class="line">221</td><td class="hits">0</td><td class="source"> curve = this._getCurve();</td></tr><tr class="miss"><td class="line">222</td><td class="hits">0</td><td class="source"> this.temp.lane = curve;</td></tr><tr class="miss"><td class="line">223</td><td class="hits">0</td><td class="source"> this.temp.position = 0;</td></tr><tr class="miss"><td class="line">224</td><td class="hits">0</td><td class="source"> return this.next.position -= this.temp.lane.length;</td></tr><tr><td class="line">225</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">226</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">227</td><td class="hits">1</td><td class="source"> Trajectory.prototype._finishChangingLanes = function() {</td></tr><tr class="miss"><td class="line">228</td><td class="hits">0</td><td class="source"> if (!this.isChangingLanes) {</td></tr><tr class="miss"><td class="line">229</td><td class="hits">0</td><td class="source"> throw Error('no lane changing is going on');</td></tr><tr><td class="line">230</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">231</td><td class="hits">0</td><td class="source"> this.isChangingLanes = false;</td></tr><tr class="miss"><td class="line">232</td><td class="hits">0</td><td class="source"> this.current.lane = this.next.lane;</td></tr><tr class="miss"><td class="line">233</td><td class="hits">0</td><td class="source"> this.current.position = this.next.position || 0;</td></tr><tr class="miss"><td class="line">234</td><td class="hits">0</td><td class="source"> this.current.acquire();</td></tr><tr class="miss"><td class="line">235</td><td class="hits">0</td><td class="source"> this.next.lane = null;</td></tr><tr class="miss"><td class="line">236</td><td class="hits">0</td><td class="source"> this.next.position = NaN;</td></tr><tr class="miss"><td class="line">237</td><td class="hits">0</td><td class="source"> this.temp.lane = null;</td></tr><tr class="miss"><td class="line">238</td><td class="hits">0</td><td class="source"> this.temp.position = NaN;</td></tr><tr class="miss"><td class="line">239</td><td class="hits">0</td><td class="source"> return this.current.lane;</td></tr><tr><td class="line">240</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">241</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">242</td><td class="hits">1</td><td class="source"> Trajectory.prototype.release = function() {</td></tr><tr class="miss"><td class="line">243</td><td class="hits">0</td><td class="source"> var _ref, _ref1, _ref2;</td></tr><tr class="miss"><td class="line">244</td><td class="hits">0</td><td class="source"> if ((_ref = this.current) != null) {</td></tr><tr class="miss"><td class="line">245</td><td class="hits">0</td><td class="source"> _ref.release();</td></tr><tr><td class="line">246</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">247</td><td class="hits">0</td><td class="source"> if ((_ref1 = this.next) != null) {</td></tr><tr class="miss"><td class="line">248</td><td class="hits">0</td><td class="source"> _ref1.release();</td></tr><tr><td class="line">249</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">250</td><td class="hits">0</td><td class="source"> return (_ref2 = this.temp) != null ? _ref2.release() : void 0;</td></tr><tr><td class="line">251</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">252</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">253</td><td class="hits">1</td><td class="source"> return Trajectory;</td></tr><tr><td class="line">254</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">255</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">256</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">257</td><td class="hits">1</td><td class="source"> module.exports = Trajectory;</td></tr><tr><td class="line">258</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">259</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">260</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/model/world.coffee">/home/aurelien/RoadTrafficSimulator/coffee/model/world.coffee</h2><div id="stats" class="terrible"><div class="percentage">20%</div><div class="sloc">162</div><div class="hits">33</div><div class="misses">129</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var Car, Intersection, Pool, Rect, Road, World, random, settings, _,</td></tr><tr class="miss"><td class="line">4</td><td class="hits">0</td><td class="source"> __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };</td></tr><tr><td class="line">5</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">6</td><td class="hits">1</td><td class="source"> random = Math.random;</td></tr><tr><td class="line">7</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">8</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">9</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">10</td><td class="hits">1</td><td class="source"> _ = require('underscore');</td></tr><tr><td class="line">11</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">12</td><td class="hits">1</td><td class="source"> Car = require('./car');</td></tr><tr><td class="line">13</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">14</td><td class="hits">1</td><td class="source"> Intersection = require('./intersection');</td></tr><tr><td class="line">15</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">16</td><td class="hits">1</td><td class="source"> Road = require('./road');</td></tr><tr><td class="line">17</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">18</td><td class="hits">1</td><td class="source"> Pool = require('./pool');</td></tr><tr><td class="line">19</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">20</td><td class="hits">1</td><td class="source"> Rect = require('../geom/rect');</td></tr><tr><td class="line">21</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">22</td><td class="hits">1</td><td class="source"> settings = require('../settings');</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">24</td><td class="hits">1</td><td class="source"> World = (function() {</td></tr><tr class="hit"><td class="line">25</td><td class="hits">1</td><td class="source"> function World() {</td></tr><tr class="miss"><td class="line">26</td><td class="hits">0</td><td class="source"> this.onTick = __bind(this.onTick, this);</td></tr><tr class="miss"><td class="line">27</td><td class="hits">0</td><td class="source"> this.set({});</td></tr><tr><td class="line">28</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">30</td><td class="hits">1</td><td class="source"> World.property('instantSpeed', {</td></tr><tr><td class="line">31</td><td class="hits"></td><td class="source"> get: function() {</td></tr><tr class="miss"><td class="line">32</td><td class="hits">0</td><td class="source"> var speeds;</td></tr><tr class="miss"><td class="line">33</td><td class="hits">0</td><td class="source"> speeds = _.map(this.cars.all(), function(car) {</td></tr><tr class="miss"><td class="line">34</td><td class="hits">0</td><td class="source"> return car.speed;</td></tr><tr><td class="line">35</td><td class="hits"></td><td class="source"> });</td></tr><tr class="miss"><td class="line">36</td><td class="hits">0</td><td class="source"> if (speeds.length === 0) {</td></tr><tr class="miss"><td class="line">37</td><td class="hits">0</td><td class="source"> return 0;</td></tr><tr><td class="line">38</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">39</td><td class="hits">0</td><td class="source"> return (_.reduce(speeds, function(a, b) {</td></tr><tr class="miss"><td class="line">40</td><td class="hits">0</td><td class="source"> return a + b;</td></tr><tr><td class="line">41</td><td class="hits"></td><td class="source"> })) / speeds.length;</td></tr><tr><td class="line">42</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">43</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">44</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">45</td><td class="hits">1</td><td class="source"> World.prototype.set = function(obj) {</td></tr><tr class="miss"><td class="line">46</td><td class="hits">0</td><td class="source"> if (obj == null) {</td></tr><tr class="miss"><td class="line">47</td><td class="hits">0</td><td class="source"> obj = {};</td></tr><tr><td class="line">48</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">49</td><td class="hits">0</td><td class="source"> this.intersections = new Pool(Intersection, obj.intersections);</td></tr><tr class="miss"><td class="line">50</td><td class="hits">0</td><td class="source"> this.roads = new Pool(Road, obj.roads);</td></tr><tr class="miss"><td class="line">51</td><td class="hits">0</td><td class="source"> this.cars = new Pool(Car, obj.cars);</td></tr><tr class="miss"><td class="line">52</td><td class="hits">0</td><td class="source"> return this.carsNumber = 0;</td></tr><tr><td class="line">53</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">54</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">55</td><td class="hits">1</td><td class="source"> World.prototype.save = function() {</td></tr><tr class="miss"><td class="line">56</td><td class="hits">0</td><td class="source"> var data;</td></tr><tr class="miss"><td class="line">57</td><td class="hits">0</td><td class="source"> data = _.extend({}, this);</td></tr><tr class="miss"><td class="line">58</td><td class="hits">0</td><td class="source"> delete data.cars;</td></tr><tr class="miss"><td class="line">59</td><td class="hits">0</td><td class="source"> return localStorage.world = JSON.stringify(data);</td></tr><tr><td class="line">60</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">61</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">62</td><td class="hits">1</td><td class="source"> World.prototype.load = function() {</td></tr><tr class="miss"><td class="line">63</td><td class="hits">0</td><td class="source"> var data, id, intersection, road, _ref, _ref1, _results;</td></tr><tr class="miss"><td class="line">64</td><td class="hits">0</td><td class="source"> data = localStorage.world;</td></tr><tr class="miss"><td class="line">65</td><td class="hits">0</td><td class="source"> data = data && JSON.parse(data);</td></tr><tr class="miss"><td class="line">66</td><td class="hits">0</td><td class="source"> if (data == null) {</td></tr><tr class="miss"><td class="line">67</td><td class="hits">0</td><td class="source"> return;</td></tr><tr><td class="line">68</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">69</td><td class="hits">0</td><td class="source"> this.clear();</td></tr><tr class="miss"><td class="line">70</td><td class="hits">0</td><td class="source"> this.carsNumber = data.carsNumber || 0;</td></tr><tr class="miss"><td class="line">71</td><td class="hits">0</td><td class="source"> _ref = data.intersections;</td></tr><tr class="miss"><td class="line">72</td><td class="hits">0</td><td class="source"> for (id in _ref) {</td></tr><tr class="miss"><td class="line">73</td><td class="hits">0</td><td class="source"> intersection = _ref[id];</td></tr><tr class="miss"><td class="line">74</td><td class="hits">0</td><td class="source"> this.addIntersection(Intersection.copy(intersection));</td></tr><tr><td class="line">75</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">76</td><td class="hits">0</td><td class="source"> _ref1 = data.roads;</td></tr><tr class="miss"><td class="line">77</td><td class="hits">0</td><td class="source"> _results = [];</td></tr><tr class="miss"><td class="line">78</td><td class="hits">0</td><td class="source"> for (id in _ref1) {</td></tr><tr class="miss"><td class="line">79</td><td class="hits">0</td><td class="source"> road = _ref1[id];</td></tr><tr class="miss"><td class="line">80</td><td class="hits">0</td><td class="source"> road = Road.copy(road);</td></tr><tr class="miss"><td class="line">81</td><td class="hits">0</td><td class="source"> road.source = this.getIntersection(road.source);</td></tr><tr class="miss"><td class="line">82</td><td class="hits">0</td><td class="source"> road.target = this.getIntersection(road.target);</td></tr><tr class="miss"><td class="line">83</td><td class="hits">0</td><td class="source"> _results.push(this.addRoad(road));</td></tr><tr><td class="line">84</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">85</td><td class="hits">0</td><td class="source"> return _results;</td></tr><tr><td class="line">86</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">87</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">88</td><td class="hits">1</td><td class="source"> World.prototype.generateMap = function(minX, maxX, minY, maxY) {</td></tr><tr class="miss"><td class="line">89</td><td class="hits">0</td><td class="source"> var gridSize, intersection, intersectionsNumber, map, previous, rect, step, x, y, _i, _j, _k, _l;</td></tr><tr class="miss"><td class="line">90</td><td class="hits">0</td><td class="source"> if (minX == null) {</td></tr><tr class="miss"><td class="line">91</td><td class="hits">0</td><td class="source"> minX = -2;</td></tr><tr><td class="line">92</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">93</td><td class="hits">0</td><td class="source"> if (maxX == null) {</td></tr><tr class="miss"><td class="line">94</td><td class="hits">0</td><td class="source"> maxX = 2;</td></tr><tr><td class="line">95</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">96</td><td class="hits">0</td><td class="source"> if (minY == null) {</td></tr><tr class="miss"><td class="line">97</td><td class="hits">0</td><td class="source"> minY = -2;</td></tr><tr><td class="line">98</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">99</td><td class="hits">0</td><td class="source"> if (maxY == null) {</td></tr><tr class="miss"><td class="line">100</td><td class="hits">0</td><td class="source"> maxY = 2;</td></tr><tr><td class="line">101</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">102</td><td class="hits">0</td><td class="source"> this.clear();</td></tr><tr class="miss"><td class="line">103</td><td class="hits">0</td><td class="source"> intersectionsNumber = (0.8 * (maxX - minX + 1) * (maxY - minY + 1)) | 0;</td></tr><tr class="miss"><td class="line">104</td><td class="hits">0</td><td class="source"> map = {};</td></tr><tr class="miss"><td class="line">105</td><td class="hits">0</td><td class="source"> gridSize = settings.gridSize;</td></tr><tr class="miss"><td class="line">106</td><td class="hits">0</td><td class="source"> step = 5 * gridSize;</td></tr><tr class="miss"><td class="line">107</td><td class="hits">0</td><td class="source"> while (intersectionsNumber > 0) {</td></tr><tr class="miss"><td class="line">108</td><td class="hits">0</td><td class="source"> x = _.random(minX, maxX);</td></tr><tr class="miss"><td class="line">109</td><td class="hits">0</td><td class="source"> y = _.random(minY, maxY);</td></tr><tr class="miss"><td class="line">110</td><td class="hits">0</td><td class="source"> if (map[[x, y]] == null) {</td></tr><tr class="miss"><td class="line">111</td><td class="hits">0</td><td class="source"> rect = new Rect(step * x, step * y, gridSize, gridSize);</td></tr><tr class="miss"><td class="line">112</td><td class="hits">0</td><td class="source"> intersection = new Intersection(rect);</td></tr><tr class="miss"><td class="line">113</td><td class="hits">0</td><td class="source"> this.addIntersection(map[[x, y]] = intersection);</td></tr><tr class="miss"><td class="line">114</td><td class="hits">0</td><td class="source"> intersectionsNumber -= 1;</td></tr><tr><td class="line">115</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">116</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">117</td><td class="hits">0</td><td class="source"> for (x = _i = minX; minX <= maxX ? _i <= maxX : _i >= maxX; x = minX <= maxX ? ++_i : --_i) {</td></tr><tr class="miss"><td class="line">118</td><td class="hits">0</td><td class="source"> previous = null;</td></tr><tr class="miss"><td class="line">119</td><td class="hits">0</td><td class="source"> for (y = _j = minY; minY <= maxY ? _j <= maxY : _j >= maxY; y = minY <= maxY ? ++_j : --_j) {</td></tr><tr class="miss"><td class="line">120</td><td class="hits">0</td><td class="source"> intersection = map[[x, y]];</td></tr><tr class="miss"><td class="line">121</td><td class="hits">0</td><td class="source"> if (intersection != null) {</td></tr><tr class="miss"><td class="line">122</td><td class="hits">0</td><td class="source"> if (random() < 0.9) {</td></tr><tr class="miss"><td class="line">123</td><td class="hits">0</td><td class="source"> if (previous != null) {</td></tr><tr class="miss"><td class="line">124</td><td class="hits">0</td><td class="source"> this.addRoad(new Road(intersection, previous));</td></tr><tr><td class="line">125</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">126</td><td class="hits">0</td><td class="source"> if (previous != null) {</td></tr><tr class="miss"><td class="line">127</td><td class="hits">0</td><td class="source"> this.addRoad(new Road(previous, intersection));</td></tr><tr><td class="line">128</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">129</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">130</td><td class="hits">0</td><td class="source"> previous = intersection;</td></tr><tr><td class="line">131</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">132</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">133</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">134</td><td class="hits">0</td><td class="source"> for (y = _k = minY; minY <= maxY ? _k <= maxY : _k >= maxY; y = minY <= maxY ? ++_k : --_k) {</td></tr><tr class="miss"><td class="line">135</td><td class="hits">0</td><td class="source"> previous = null;</td></tr><tr class="miss"><td class="line">136</td><td class="hits">0</td><td class="source"> for (x = _l = minX; minX <= maxX ? _l <= maxX : _l >= maxX; x = minX <= maxX ? ++_l : --_l) {</td></tr><tr class="miss"><td class="line">137</td><td class="hits">0</td><td class="source"> intersection = map[[x, y]];</td></tr><tr class="miss"><td class="line">138</td><td class="hits">0</td><td class="source"> if (intersection != null) {</td></tr><tr class="miss"><td class="line">139</td><td class="hits">0</td><td class="source"> if (random() < 0.9) {</td></tr><tr class="miss"><td class="line">140</td><td class="hits">0</td><td class="source"> if (previous != null) {</td></tr><tr class="miss"><td class="line">141</td><td class="hits">0</td><td class="source"> this.addRoad(new Road(intersection, previous));</td></tr><tr><td class="line">142</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">143</td><td class="hits">0</td><td class="source"> if (previous != null) {</td></tr><tr class="miss"><td class="line">144</td><td class="hits">0</td><td class="source"> this.addRoad(new Road(previous, intersection));</td></tr><tr><td class="line">145</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">146</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">147</td><td class="hits">0</td><td class="source"> previous = intersection;</td></tr><tr><td class="line">148</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">149</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">150</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">151</td><td class="hits">0</td><td class="source"> return null;</td></tr><tr><td class="line">152</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">153</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">154</td><td class="hits">1</td><td class="source"> World.prototype.clear = function() {</td></tr><tr class="miss"><td class="line">155</td><td class="hits">0</td><td class="source"> return this.set({});</td></tr><tr><td class="line">156</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">157</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">158</td><td class="hits">1</td><td class="source"> World.prototype.onTick = function(delta) {</td></tr><tr class="miss"><td class="line">159</td><td class="hits">0</td><td class="source"> var car, id, intersection, _ref, _ref1, _results;</td></tr><tr class="miss"><td class="line">160</td><td class="hits">0</td><td class="source"> if (delta > 1) {</td></tr><tr class="miss"><td class="line">161</td><td class="hits">0</td><td class="source"> throw Error('delta > 1');</td></tr><tr><td class="line">162</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">163</td><td class="hits">0</td><td class="source"> this.refreshCars();</td></tr><tr class="miss"><td class="line">164</td><td class="hits">0</td><td class="source"> _ref = this.intersections.all();</td></tr><tr class="miss"><td class="line">165</td><td class="hits">0</td><td class="source"> for (id in _ref) {</td></tr><tr class="miss"><td class="line">166</td><td class="hits">0</td><td class="source"> intersection = _ref[id];</td></tr><tr class="miss"><td class="line">167</td><td class="hits">0</td><td class="source"> intersection.controlSignals.onTick(delta);</td></tr><tr><td class="line">168</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">169</td><td class="hits">0</td><td class="source"> _ref1 = this.cars.all();</td></tr><tr class="miss"><td class="line">170</td><td class="hits">0</td><td class="source"> _results = [];</td></tr><tr class="miss"><td class="line">171</td><td class="hits">0</td><td class="source"> for (id in _ref1) {</td></tr><tr class="miss"><td class="line">172</td><td class="hits">0</td><td class="source"> car = _ref1[id];</td></tr><tr class="miss"><td class="line">173</td><td class="hits">0</td><td class="source"> car.move(delta);</td></tr><tr class="miss"><td class="line">174</td><td class="hits">0</td><td class="source"> if (!car.alive) {</td></tr><tr class="miss"><td class="line">175</td><td class="hits">0</td><td class="source"> _results.push(this.removeCar(car));</td></tr><tr><td class="line">176</td><td class="hits"></td><td class="source"> } else {</td></tr><tr class="miss"><td class="line">177</td><td class="hits">0</td><td class="source"> _results.push(void 0);</td></tr><tr><td class="line">178</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">179</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">180</td><td class="hits">0</td><td class="source"> return _results;</td></tr><tr><td class="line">181</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">182</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">183</td><td class="hits">1</td><td class="source"> World.prototype.refreshCars = function() {</td></tr><tr class="miss"><td class="line">184</td><td class="hits">0</td><td class="source"> if (this.roads.length === 0) {</td></tr><tr class="miss"><td class="line">185</td><td class="hits">0</td><td class="source"> this.carsNumber = 0;</td></tr><tr><td class="line">186</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">187</td><td class="hits">0</td><td class="source"> if (this.cars.length < this.carsNumber) {</td></tr><tr class="miss"><td class="line">188</td><td class="hits">0</td><td class="source"> this.addRandomCar();</td></tr><tr><td class="line">189</td><td class="hits"></td><td class="source"> }</td></tr><tr class="miss"><td class="line">190</td><td class="hits">0</td><td class="source"> if (this.cars.length > this.carsNumber) {</td></tr><tr class="miss"><td class="line">191</td><td class="hits">0</td><td class="source"> return this.removeRandomCar();</td></tr><tr><td class="line">192</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">193</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">194</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">195</td><td class="hits">1</td><td class="source"> World.prototype.addRoad = function(road) {</td></tr><tr class="miss"><td class="line">196</td><td class="hits">0</td><td class="source"> this.roads.put(road);</td></tr><tr class="miss"><td class="line">197</td><td class="hits">0</td><td class="source"> road.source.roads.push(road);</td></tr><tr class="miss"><td class="line">198</td><td class="hits">0</td><td class="source"> road.target.inRoads.push(road);</td></tr><tr class="miss"><td class="line">199</td><td class="hits">0</td><td class="source"> return road.update();</td></tr><tr><td class="line">200</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">201</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">202</td><td class="hits">1</td><td class="source"> World.prototype.getRoad = function(id) {</td></tr><tr class="miss"><td class="line">203</td><td class="hits">0</td><td class="source"> return this.roads.get(id);</td></tr><tr><td class="line">204</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">205</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">206</td><td class="hits">1</td><td class="source"> World.prototype.addCar = function(car) {</td></tr><tr class="miss"><td class="line">207</td><td class="hits">0</td><td class="source"> return this.cars.put(car);</td></tr><tr><td class="line">208</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">209</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">210</td><td class="hits">1</td><td class="source"> World.prototype.getCar = function(id) {</td></tr><tr class="miss"><td class="line">211</td><td class="hits">0</td><td class="source"> return this.cars.get(id);</td></tr><tr><td class="line">212</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">213</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">214</td><td class="hits">1</td><td class="source"> World.prototype.removeCar = function(car) {</td></tr><tr class="miss"><td class="line">215</td><td class="hits">0</td><td class="source"> return this.cars.pop(car);</td></tr><tr><td class="line">216</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">217</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">218</td><td class="hits">1</td><td class="source"> World.prototype.addIntersection = function(intersection) {</td></tr><tr class="miss"><td class="line">219</td><td class="hits">0</td><td class="source"> return this.intersections.put(intersection);</td></tr><tr><td class="line">220</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">221</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">222</td><td class="hits">1</td><td class="source"> World.prototype.getIntersection = function(id) {</td></tr><tr class="miss"><td class="line">223</td><td class="hits">0</td><td class="source"> return this.intersections.get(id);</td></tr><tr><td class="line">224</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">225</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">226</td><td class="hits">1</td><td class="source"> World.prototype.addRandomCar = function() {</td></tr><tr class="miss"><td class="line">227</td><td class="hits">0</td><td class="source"> var lane, road;</td></tr><tr class="miss"><td class="line">228</td><td class="hits">0</td><td class="source"> road = _.sample(this.roads.all());</td></tr><tr class="miss"><td class="line">229</td><td class="hits">0</td><td class="source"> if (road != null) {</td></tr><tr class="miss"><td class="line">230</td><td class="hits">0</td><td class="source"> lane = _.sample(road.lanes);</td></tr><tr class="miss"><td class="line">231</td><td class="hits">0</td><td class="source"> if (lane != null) {</td></tr><tr class="miss"><td class="line">232</td><td class="hits">0</td><td class="source"> return this.addCar(new Car(lane));</td></tr><tr><td class="line">233</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">234</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">235</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">236</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">237</td><td class="hits">1</td><td class="source"> World.prototype.removeRandomCar = function() {</td></tr><tr class="miss"><td class="line">238</td><td class="hits">0</td><td class="source"> var car;</td></tr><tr class="miss"><td class="line">239</td><td class="hits">0</td><td class="source"> car = _.sample(this.cars.all());</td></tr><tr class="miss"><td class="line">240</td><td class="hits">0</td><td class="source"> if (car != null) {</td></tr><tr class="miss"><td class="line">241</td><td class="hits">0</td><td class="source"> return this.removeCar(car);</td></tr><tr><td class="line">242</td><td class="hits"></td><td class="source"> }</td></tr><tr><td class="line">243</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">244</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">245</td><td class="hits">1</td><td class="source"> return World;</td></tr><tr><td class="line">246</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">247</td><td class="hits"></td><td class="source"> })();</td></tr><tr><td class="line">248</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">249</td><td class="hits">1</td><td class="source"> module.exports = World;</td></tr><tr><td class="line">250</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">251</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">252</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/settings.coffee">/home/aurelien/RoadTrafficSimulator/coffee/settings.coffee</h2><div id="stats" class="high"><div class="percentage">100%</div><div class="sloc">5</div><div class="hits">5</div><div class="misses">0</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var settings;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> settings = {</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> colors: {</td></tr><tr><td class="line">7</td><td class="hits"></td><td class="source"> background: '#97a1a1',</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> redLight: 'hsl(0, 100%, 50%)',</td></tr><tr><td class="line">9</td><td class="hits"></td><td class="source"> greenLight: '#85ee00',</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> intersection: '#586970',</td></tr><tr><td class="line">11</td><td class="hits"></td><td class="source"> road: '#586970',</td></tr><tr><td class="line">12</td><td class="hits"></td><td class="source"> roadMarking: '#bbb',</td></tr><tr><td class="line">13</td><td class="hits"></td><td class="source"> hoveredIntersection: '#3d4c53',</td></tr><tr><td class="line">14</td><td class="hits"></td><td class="source"> tempRoad: '#aaa',</td></tr><tr><td class="line">15</td><td class="hits"></td><td class="source"> gridPoint: '#586970',</td></tr><tr><td class="line">16</td><td class="hits"></td><td class="source"> grid1: 'rgba(255, 255, 255, 0.5)',</td></tr><tr><td class="line">17</td><td class="hits"></td><td class="source"> grid2: 'rgba(220, 220, 220, 0.5)',</td></tr><tr><td class="line">18</td><td class="hits"></td><td class="source"> hoveredGrid: '#f4e8e1'</td></tr><tr><td class="line">19</td><td class="hits"></td><td class="source"> },</td></tr><tr><td class="line">20</td><td class="hits"></td><td class="source"> fps: 30,</td></tr><tr><td class="line">21</td><td class="hits"></td><td class="source"> lightsFlipInterval: 20,</td></tr><tr><td class="line">22</td><td class="hits"></td><td class="source"> gridSize: 14,</td></tr><tr><td class="line">23</td><td class="hits"></td><td class="source"> defaultTimeFactor: 5</td></tr><tr><td class="line">24</td><td class="hits"></td><td class="source"> };</td></tr><tr><td class="line">25</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">26</td><td class="hits">1</td><td class="source"> module.exports = settings;</td></tr><tr><td class="line">27</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">28</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">29</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div><div class="file"><h2 id="/home/aurelien/RoadTrafficSimulator/coffee/spec/integration-spec.coffee">/home/aurelien/RoadTrafficSimulator/coffee/spec/integration-spec.coffee</h2><div id="stats" class="high"><div class="percentage">100%</div><div class="sloc">8</div><div class="hits">8</div><div class="misses">0</div></div><table id="source"><thead><tr><th>Line</th><th>Hits</th><th>Source</th></tr></thead><tbody><tr class="hit"><td class="line">1</td><td class="hits">1</td><td class="source">(function() {</td></tr><tr class="hit"><td class="line">2</td><td class="hits">1</td><td class="source"> 'use strict';</td></tr><tr class="hit"><td class="line">3</td><td class="hits">1</td><td class="source"> var World;</td></tr><tr><td class="line">4</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">5</td><td class="hits">1</td><td class="source"> require("blanket")({});</td></tr><tr><td class="line">6</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">7</td><td class="hits">1</td><td class="source"> require('../helpers');</td></tr><tr><td class="line">8</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">9</td><td class="hits">1</td><td class="source"> World = require('../model/world');</td></tr><tr><td class="line">10</td><td class="hits"></td><td class="source"> </td></tr><tr class="hit"><td class="line">11</td><td class="hits">1</td><td class="source"> describe('Application', function() {</td></tr><tr class="hit"><td class="line">12</td><td class="hits">1</td><td class="source"> return it('can run', function() {});</td></tr><tr><td class="line">13</td><td class="hits"></td><td class="source"> });</td></tr><tr><td class="line">14</td><td class="hits"></td><td class="source"> </td></tr><tr><td class="line">15</td><td class="hits"></td><td class="source">}).call(this);</td></tr><tr><td class="line">16</td><td class="hits"></td><td class="source"> </td></tr></tbody></table></div></div></div></body></html>