Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 09e23f8f6a | |||
| 87f797987b | |||
| daaad57c08 | |||
| 1d748e0204 | |||
| 343d31ad68 | |||
| 92bd738266 | |||
| 9fa0586bc5 | |||
| a68862b98e | |||
|
|
a4b64e1d95 | ||
|
|
e171804ac6 | ||
| 6376e94c84 | |||
| a591dcfc52 | |||
| 903022719e | |||
| 4b90827c2a | |||
| 61277350d8 | |||
| 7af3fb558b | |||
| a360dc708e | |||
| 3250d5a433 | |||
| 65cb0b52f6 | |||
| 87a8a1bcb6 | |||
| bce15fe90f | |||
| 542ce9c8c0 | |||
| 3a3756f701 | |||
|
|
b624cfe11e | ||
|
|
8fe4e564d3 | ||
|
|
e389c0711e | ||
| 1b6ad03057 | |||
|
|
24fe1c1d67 | ||
|
|
766eabbbe4 | ||
|
|
d7b1de1fe3 | ||
|
|
96b3a66b96 | ||
|
|
29848b04a6 | ||
| 043ba7d185 | |||
| 25f2876c34 | |||
| 7cbecc4fab | |||
| 72db59415f | |||
| 60b4f0c2b6 | |||
| 81f842e2bb | |||
|
|
108d2e544c |
4
.github/workflows/maven.yml
vendored
@@ -3,7 +3,7 @@ name: Java CI with Maven
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ "dev", "cleanup" ]
|
||||
branches: [ "main", "dev", "cleanup" ]
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
pull_request:
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
publish-release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, build-windows]
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
||||
12
.gitignore
vendored
@@ -6,6 +6,11 @@
|
||||
*.trace
|
||||
logs
|
||||
*.md
|
||||
*.tex
|
||||
!README.md
|
||||
report.aux
|
||||
report.synctex.gz
|
||||
!report.tex
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
@@ -51,9 +56,14 @@ build/
|
||||
# Other
|
||||
*.swp
|
||||
*.pdf
|
||||
!Desempenho_Linux.pdf
|
||||
|
||||
# JAR built pom file
|
||||
dependency-reduced-pom.xml
|
||||
|
||||
# Python env
|
||||
venv/
|
||||
venv/
|
||||
.$Diagrama de arquitetura - SD.drawio.bkp
|
||||
|
||||
#others
|
||||
*.out
|
||||
|
||||
BIN
Desempenho_Linux.pdf
Normal file
@@ -1,27 +0,0 @@
|
||||
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" version="28.2.7">
|
||||
<diagram name="Página-1" id="B1_hHcevBzWlEwI7FSV6">
|
||||
<mxGraphModel dx="778" dy="476" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="vcp7vux32DhQR4tKQhnF-8" value="Dashboard" style="sketch=0;pointerEvents=1;shadow=0;dashed=0;html=1;strokeColor=#C73500;labelPosition=center;verticalLabelPosition=bottom;verticalAlign=top;align=center;fillColor=#fa6800;shape=mxgraph.mscae.oms.dashboard;fontColor=#000000;" vertex="1" parent="1">
|
||||
<mxGeometry x="389" y="230" width="50" height="41" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="vcp7vux32DhQR4tKQhnF-12" value="Semaforo.java" style="shape=image;html=1;verticalAlign=top;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;imageAspect=0;aspect=fixed;image=https://icons.diagrams.net/icon-cache1/Strabo-2829/traffic_light-1068.png" vertex="1" parent="1">
|
||||
<mxGeometry x="230" y="350" width="53" height="53" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="vcp7vux32DhQR4tKQhnF-13" value="" style="endArrow=classic;startArrow=classic;html=1;rounded=0;movable=1;resizable=1;rotatable=1;deletable=1;editable=1;locked=0;connectable=1;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="310" y="330" as="sourcePoint" />
|
||||
<mxPoint x="360" y="280" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="vcp7vux32DhQR4tKQhnF-14" value="CruzamentoServer.java" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=1;points=[];movable=1;rotatable=1;deletable=1;editable=1;locked=0;connectable=1;" vertex="1" connectable="0" parent="vcp7vux32DhQR4tKQhnF-13">
|
||||
<mxGeometry x="-0.3933" relative="1" as="geometry">
|
||||
<mxPoint x="25" y="25" as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
177
Diagrama de arquitetura.drawio
Normal file
@@ -0,0 +1,177 @@
|
||||
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (X11; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0" version="29.2.6">
|
||||
<diagram name="Arquitetura SD" id="QKeTeUWuUs8JeLsq44d-">
|
||||
<mxGraphModel dx="891" dy="484" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-27" parent="1" style="rounded=0;whiteSpace=wrap;html=1;align=left;verticalAlign=top;fillColor=#fff2cc;strokeColor=#d6b656;spacing=10;fontColor=#000000;" value="<b>MessageProtocol</b><hr>interface:<br>• getType()<br>• getPayload()<br>• getSourceNode()<br>• getDestinationNode()" vertex="1">
|
||||
<mxGeometry height="120" width="180" x="30" y="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-28" parent="1" style="rounded=0;whiteSpace=wrap;html=1;align=left;verticalAlign=top;fillColor=#fff2cc;strokeColor=#d6b656;spacing=10;fontColor=#000000;" value="<font style="color: rgb(0, 0, 0);"><b style="background-color: transparent;">Tipos de Mensagens</b><br></font><hr style="background-color: transparent;"><font style="color: rgb(0, 0, 0);"><span style="background-color: transparent;">• VEHICLE_TRANSFER</span><br><span style="background-color: transparent;">• VEHICLE_SPAWN</span><br><span style="background-color: transparent;">• STATS_UPDATE</span><br><span style="background-color: transparent;">•</span><span style="background-color: transparent;">&nbsp;</span><span style="background-color: transparent;">SIMULATION_START</span><br><span style="background-color: transparent;">•</span><span style="background-color: transparent;">&nbsp;</span><span style="background-color: transparent;">SHUTDOWN</span><br><span style="background-color: transparent;">•</span><span style="background-color: transparent;">&nbsp;</span><span style="background-color: transparent;">ROUTING_POLICY_CHANGE</span></font>" vertex="1">
|
||||
<mxGeometry height="130" width="200" x="20" y="170" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-26" parent="1" style="rounded=0;whiteSpace=wrap;html=1;align=left;verticalAlign=top;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;spacing=10;" value="<b>LEGENDA</b><hr>━━━► Comunicação síncrona<br>╌╌╌► Comunicação periódica<br><br><b>Cores:</b><br>🔵 Azul =&nbsp;<span style="background-color: transparent;">Criação do veículo</span><div>🟢 Verde = Transferência do veículo<br>🟠 Laranja = Chegada ao destino<br>🟣 Roxo =&nbsp;<span style="background-color: transparent;">Envio das estatísticas</span></div><div><br><b>Serialização:</b> JSON (Gson)<br><b>Protocolo:</b> TCP/IP</div>" vertex="1">
|
||||
<mxGeometry height="220" width="220" x="10" y="320" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="L62mICw2ZrYi1D68OOFe-13" connectable="0" parent="1" style="group;strokeColor=light-dark(transparent,#CC6600);" value="" vertex="1">
|
||||
<mxGeometry height="730" width="850" x="280" y="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-20" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#9933FF;strokeWidth=2;dashed=1;exitX=0.616;exitY=-0.011;exitDx=0;exitDy=0;entryX=0.661;entryY=-0.002;entryDx=0;entryDy=0;entryPerimeter=0;exitPerimeter=0;" target="0K4eb2koB2xQ8duQ1-_a-8" value="">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="99" y="122" />
|
||||
<mxPoint x="793" y="122" />
|
||||
</Array>
|
||||
<mxPoint x="794" y="530" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-1" parent="L62mICw2ZrYi1D68OOFe-13" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;align=left;verticalAlign=top;spacing=10;fontColor=#000000;" value="<b>CoordinatorProcess</b><br>(Cliente Socket)<hr>• VehicleGenerator<br>• Modelo Poisson<br>• Liga a Cr1-Cr5" vertex="1">
|
||||
<mxGeometry height="101.38888888888889" width="176.28318584070794" x="205.6637168141593" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-2" parent="L62mICw2ZrYi1D68OOFe-13" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;align=left;verticalAlign=top;spacing=10;fontColor=#000000;" value="<b>Cr1</b> (IntersectionProcess)<br><hr><div>• ServerSocket (8001)</div><div>• Eventos DES:&nbsp;</div><div>&nbsp; &nbsp;- Este</div><div>&nbsp; &nbsp;- Sul</div><div>• Fila Eventos (DES)</div><div>• ReentrantLock</div><div><div>• Objetos TrafficLight</div><div>• Pool Threads (I/O rede)</div></div><div><br></div>" vertex="1">
|
||||
<mxGeometry height="162.22" width="160" y="162.22" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-3" parent="L62mICw2ZrYi1D68OOFe-13" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;align=left;verticalAlign=top;spacing=10;fontColor=#000000;" value="<b>Cr2</b> (IntersectionProcess)<br><hr>• ServerSocket (8002)<br><div>• Eventos DES:&nbsp;</div><div>&nbsp; &nbsp;- Oeste</div><div>&nbsp; &nbsp;- Este</div><div>&nbsp; &nbsp;- Sul</div><div>• Fila Eventos (DES)</div><div>• ReentrantLock</div><div><div>• Objetos TrafficLight</div></div><div>• Pool Threads (I/O rede)</div>" vertex="1">
|
||||
<mxGeometry height="177.78" width="162.3" x="227.7" y="162.22" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-5" parent="L62mICw2ZrYi1D68OOFe-13" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;align=left;verticalAlign=top;spacing=10;fontColor=#000000;" value="<b>Cr4</b> (IntersectionProcess)<br><hr><div>• ServerSocket (8004)</div><div><div>• Eventos DES:&nbsp;</div><div>&nbsp; &nbsp;- Este</div><div>&nbsp; &nbsp;- Norte</div><div>• Fila Eventos (DES)<br>• ReentrantLock</div></div><div><div>• Objetos TrafficLight</div><div>• Pool Threads (I/O rede)</div></div>" vertex="1">
|
||||
<mxGeometry height="163.33" width="160" y="486.67" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-6" parent="L62mICw2ZrYi1D68OOFe-13" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;align=left;verticalAlign=top;spacing=10;fontColor=#000000;" value="<b>Cr5</b> (IntersectionProcess)<br><hr>• ServerSocket (8005)<br><div><div><div>• Eventos DES:&nbsp;</div><div>&nbsp; &nbsp;- Norte</div><div>&nbsp; &nbsp;- Este</div><div>&nbsp; &nbsp;- Sul</div>• Fila Eventos (DES)<br>• ReentrantLock</div><div><div>• Objetos TrafficLight</div><div>• Pool Threads (I/O rede)</div></div></div>" vertex="1">
|
||||
<mxGeometry height="173.33" width="169.65" x="220.35" y="486.67" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-7" parent="L62mICw2ZrYi1D68OOFe-13" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;align=left;verticalAlign=top;spacing=10;fontColor=#000000;" value="<b>ExitNode (S)</b><div><hr><div>• Server Socket (9001)<br>• Recebe veículos finais<br>• Calcula estatísticas:<br> - Tempo no sistema<br> - Tempo de espera<br> - Métricas por tipo<br>• Envia para o Dashboard</div></div>" vertex="1">
|
||||
<mxGeometry height="172.36" width="154.6" x="464.07" y="476.53" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-8" parent="L62mICw2ZrYi1D68OOFe-13" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;verticalAlign=top;spacing=10;fontColor=#000000;" value="<b>DashboardServer</b><hr>• Server Socket (9000)<br><div>• Thread Pool (10 threads)<br>• ConcurrentHashMap<br>• Agrega estatísticas<br>• Display a cada segundo:<br> - Throughput<br> - Tempos médios<br> - Tamanhos de filas</div>" vertex="1">
|
||||
<mxGeometry height="180" width="166.9" x="683.1" y="540" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-9" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#0000FF;strokeWidth=2;" target="0K4eb2koB2xQ8duQ1-_a-2" value="">
|
||||
<mxGeometry relative="1" x="-0.2105" as="geometry">
|
||||
<mxPoint as="offset" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-10" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#0000FF;strokeWidth=2;" target="0K4eb2koB2xQ8duQ1-_a-3" value="">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="309" y="120" />
|
||||
<mxPoint x="309" y="120" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-11" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#0000FF;strokeWidth=2;" target="0K4eb2koB2xQ8duQ1-_a-4" value="">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-12" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#00AA00;strokeWidth=2;endArrow=classic;startArrow=classic;" target="0K4eb2koB2xQ8duQ1-_a-3" value="">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="210" y="243" />
|
||||
<mxPoint x="210" y="243" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-14" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#00AA00;strokeWidth=2;endArrow=classic;startArrow=none;startFill=0;" target="0K4eb2koB2xQ8duQ1-_a-5" value="">
|
||||
<mxGeometry relative="1" x="0.125" y="100" as="geometry">
|
||||
<mxPoint y="-1" as="offset" />
|
||||
<Array as="points">
|
||||
<mxPoint x="66.10619469026548" y="446.11111111111114" />
|
||||
<mxPoint x="66.10619469026548" y="446.11111111111114" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-16" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#00AA00;strokeWidth=2;endArrow=classic;startArrow=none;startFill=0;align=center;" value="">
|
||||
<mxGeometry relative="1" x="-0.0178" y="-49" as="geometry">
|
||||
<mxPoint as="offset" />
|
||||
<Array as="points">
|
||||
<mxPoint x="220" y="571" />
|
||||
</Array>
|
||||
<mxPoint x="160" y="570" as="sourcePoint" />
|
||||
<mxPoint x="220" y="571" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-19" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#b46504;strokeWidth=2;fillColor=#fad7ac;" value="">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points" />
|
||||
<mxPoint x="390" y="580" as="sourcePoint" />
|
||||
<mxPoint x="462.74" y="580.22" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-22" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#9933FF;strokeWidth=2;dashed=1;exitX=0.981;exitY=0.08;exitDx=0;exitDy=0;exitPerimeter=0;" target="0K4eb2koB2xQ8duQ1-_a-8" value="">
|
||||
<mxGeometry relative="1" x="0.1427" y="-60" as="geometry">
|
||||
<mxPoint as="offset" />
|
||||
<Array as="points">
|
||||
<mxPoint x="593" y="175" />
|
||||
<mxPoint x="593" y="140" />
|
||||
<mxPoint x="764" y="140" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-4" parent="L62mICw2ZrYi1D68OOFe-13" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;align=left;verticalAlign=top;spacing=10;fontColor=#000000;" value="<b>Cr3</b> (IntersectionProcess)<div><hr></div><div>• ServerSocket (8003)<br><div>• Eventos DES:&nbsp;</div><div>&nbsp; &nbsp;- Oeste</div><div>&nbsp; &nbsp;- Sul</div><div>• Fila Eventos (DES)</div>• ReentrantLock</div><div><div>• Objetos TrafficLight</div></div><div>• Pool Threads (I/O rede)</div>" vertex="1">
|
||||
<mxGeometry height="157.78" width="167.26" x="462.74" y="162.22" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="0K4eb2koB2xQ8duQ1-_a-30" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#9933FF;strokeWidth=2;dashed=1;entryX=0.186;entryY=0.998;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.638;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;" target="0K4eb2koB2xQ8duQ1-_a-8" value="">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="102" y="730" />
|
||||
<mxPoint x="714" y="730" />
|
||||
</Array>
|
||||
<mxPoint x="103" y="660" as="sourcePoint" />
|
||||
<mxPoint x="710" y="730" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="L62mICw2ZrYi1D68OOFe-2" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#00AA00;strokeWidth=2;endArrow=none;startArrow=classic;startFill=1;endFill=0;entryX=0.409;entryY=0.993;entryDx=0;entryDy=0;entryPerimeter=0;" target="0K4eb2koB2xQ8duQ1-_a-3" value="">
|
||||
<mxGeometry relative="1" x="-0.2214" y="26" as="geometry">
|
||||
<mxPoint x="-17" y="6" as="offset" />
|
||||
<Array as="points" />
|
||||
<mxPoint x="293.8053097345133" y="486.6666666666666" as="sourcePoint" />
|
||||
<mxPoint x="293.8053097345133" y="324.44444444444446" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="L62mICw2ZrYi1D68OOFe-10" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#9933FF;strokeWidth=2;dashed=1;exitX=0.621;exitY=-0.003;exitDx=0;exitDy=0;exitPerimeter=0;" value="">
|
||||
<mxGeometry relative="1" x="0.1427" y="-60" as="geometry">
|
||||
<mxPoint as="offset" />
|
||||
<Array as="points">
|
||||
<mxPoint x="329" y="130" />
|
||||
<mxPoint x="780" y="130" />
|
||||
</Array>
|
||||
<mxPoint x="330.53097345132744" y="141.94444444444443" as="sourcePoint" />
|
||||
<mxPoint x="780" y="540" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="L62mICw2ZrYi1D68OOFe-11" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#9933FF;strokeWidth=2;dashed=1;exitX=0.627;exitY=1.014;exitDx=0;exitDy=0;exitPerimeter=0;" value="">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="327" y="700" />
|
||||
</Array>
|
||||
<mxPoint x="326" y="654" as="sourcePoint" />
|
||||
<mxPoint x="683.1" y="700" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="L62mICw2ZrYi1D68OOFe-12" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#9933FF;strokeWidth=2;dashed=1;" value="">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="556" y="663" />
|
||||
</Array>
|
||||
<mxPoint x="556" y="650" as="sourcePoint" />
|
||||
<mxPoint x="683.0973451327434" y="663.0833333333331" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="J0awZyeCmWOCt0z9hVlQ-7" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=light-dark(#00AA00,#C98531);strokeWidth=2;endArrow=none;startArrow=classic;startFill=1;endFill=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" value="">
|
||||
<mxGeometry relative="1" x="-0.2214" y="26" as="geometry">
|
||||
<mxPoint x="-17" y="6" as="offset" />
|
||||
<Array as="points" />
|
||||
<mxPoint x="541" y="470" as="sourcePoint" />
|
||||
<mxPoint x="541.17" y="320" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="J0awZyeCmWOCt0z9hVlQ-33" edge="1" parent="L62mICw2ZrYi1D68OOFe-13" source="0K4eb2koB2xQ8duQ1-_a-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#00AA00;strokeWidth=2;endArrow=classic;startArrow=classic;entryX=-0.001;entryY=0.513;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0.454;exitDx=0;exitDy=0;exitPerimeter=0;" target="0K4eb2koB2xQ8duQ1-_a-4" value="">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points" />
|
||||
<mxPoint x="391" y="243.13" as="sourcePoint" />
|
||||
<mxPoint x="460" y="243" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
BIN
Diagrama de arquitetura.jpg
Normal file
|
After Width: | Height: | Size: 220 KiB |
BIN
Enunciado.pdf
Normal file
54
README.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# DTSS - Distributed Traffic Simulation System
|
||||
|
||||
**Sistemas Distribuídos 2025/2026**
|
||||
**Autores:** David Alves, Leandro Afonso, Gabriel Moreira
|
||||
|
||||
Simulador de tráfego distribuído (Malha 3x3) com comunicação TCP/IP e modelo de eventos discretos.
|
||||
|
||||
### 📋 Pré-requisitos
|
||||
|
||||
* **Java 17+**
|
||||
* **Maven 3.6+**
|
||||
|
||||
-----
|
||||
|
||||
### Build
|
||||
|
||||
Compilar e gerar o JAR executável:
|
||||
|
||||
```bash
|
||||
cd main
|
||||
mvn clean package
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
### Execução
|
||||
|
||||
Inicia todos os processos (Dashboard, Coordenador, Nós, Saída) numa única instância.
|
||||
|
||||
```bash
|
||||
cd main
|
||||
mvn javafx:run
|
||||
```
|
||||
|
||||
-----
|
||||
|
||||
### Cenários de Carga
|
||||
|
||||
**Arquivos disponíveis em `src/main/resources/`:**
|
||||
|
||||
* `simulation-low.properties` ($\lambda=0.2$)
|
||||
* `simulation-medium.properties` ($\lambda=0.5$)
|
||||
* `simulation-high.properties` ($\lambda=1.0$)
|
||||
|
||||
-----
|
||||
|
||||
### Troubleshooting Rápido
|
||||
|
||||
**Port already in use / Limpeza de Processos:**
|
||||
Se a simulação falhar ou portas ficarem presas, matar todos os processos Java associados:
|
||||
|
||||
```bash
|
||||
pkill -f "sd.IntersectionProcess|sd.dashboard.DashboardServer|sd.coordinator.CoordinatorProcess"
|
||||
```
|
||||
@@ -1,6 +0,0 @@
|
||||
Execução,VeículosGerados,VeículosCompletados,TaxaConclusão,TempoMédioSistema,TempoMédioEspera,TempoMínimoSistema,TempoMáximoSistema
|
||||
1,1784,877,49.16,64.58,61.43,32.29,129.16
|
||||
2,1782,363,20.37,53.77,51.01,26.88,107.53
|
||||
3,1786,883,49.44,53.09,50.08,26.54,106.17
|
||||
4,1845,179,9.70,63.92,60.27,31.96,127.84
|
||||
5,1872,953,50.91,65.41,62.16,32.70,130.81
|
||||
|
@@ -1,215 +0,0 @@
|
||||
================================================================================
|
||||
ANÁLISE ESTATÍSTICA MULTI-EXECUÇÃO
|
||||
================================================================================
|
||||
Configuração: simulation-high.properties
|
||||
Número de Execuções: 5
|
||||
Data da Análise: 2025-12-07 00:11:13
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
MÉTRICAS GLOBAIS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Veículos Gerados:
|
||||
Média: 1813.80 Desvio Padrão: 41.93
|
||||
Mediana: 1786.00 IC 95%: [1754.13, 1873.47]
|
||||
Mín: 1782.00 Máx: 1872.00
|
||||
|
||||
Veículos Completados:
|
||||
Média: 651.00 Desvio Padrão: 354.20
|
||||
Mediana: 877.00 IC 95%: [146.96, 1155.04]
|
||||
Mín: 179.00 Máx: 953.00
|
||||
|
||||
Taxa de Conclusão (%):
|
||||
Média: 35.92 Desvio Padrão: 19.44
|
||||
Mediana: 49.16 IC 95%: [8.25, 63.58]
|
||||
Mín: 9.70 Máx: 50.91
|
||||
|
||||
Tempo Médio no Sistema (segundos):
|
||||
Média: 60.15 Desvio Padrão: 6.17
|
||||
Mediana: 63.92 IC 95%: [51.38, 68.93]
|
||||
Mín: 53.09 Máx: 65.41
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 56.99 Desvio Padrão: 5.93
|
||||
Mediana: 60.27 IC 95%: [48.55, 65.43]
|
||||
Mín: 50.08 Máx: 62.16
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR TIPO DE VEÍCULO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- BIKE ---
|
||||
Contagem de Veículos:
|
||||
Média: 135.40 Desvio Padrão: 77.66
|
||||
Mediana: 167.00 IC 95%: [24.89, 245.91]
|
||||
Mín: 37.00 Máx: 211.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 55.15 Desvio Padrão: 12.01
|
||||
Mediana: 54.23 IC 95%: [38.07, 72.24]
|
||||
Mín: 43.41 Máx: 74.99
|
||||
|
||||
|
||||
--- LIGHT ---
|
||||
Contagem de Veículos:
|
||||
Média: 395.00 Desvio Padrão: 207.62
|
||||
Mediana: 540.00 IC 95%: [99.55, 690.45]
|
||||
Mín: 107.00 Máx: 548.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 59.79 Desvio Padrão: 7.28
|
||||
Mediana: 61.58 IC 95%: [49.43, 70.15]
|
||||
Mín: 50.81 Máx: 69.26
|
||||
|
||||
|
||||
--- HEAVY ---
|
||||
Contagem de Veículos:
|
||||
Média: 120.60 Desvio Padrão: 72.95
|
||||
Mediana: 142.00 IC 95%: [16.79, 224.41]
|
||||
Mín: 35.00 Máx: 202.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 49.20 Desvio Padrão: 8.62
|
||||
Mediana: 50.31 IC 95%: [36.94, 61.46]
|
||||
Mín: 35.51 Máx: 58.20
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR INTERSEÇÃO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- Cr1 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 3.20 Desvio Padrão: 5.54
|
||||
Mediana: 1.00 IC 95%: [-4.68, 11.08]
|
||||
Mín: 0.00 Máx: 13.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 3.20 Desvio Padrão: 5.54
|
||||
Mediana: 1.00 IC 95%: [-4.68, 11.08]
|
||||
Mín: 0.00 Máx: 13.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 378.40 Desvio Padrão: 252.94
|
||||
Mediana: 512.00 IC 95%: [18.46, 738.34]
|
||||
Mín: 58.00 Máx: 600.00
|
||||
|
||||
|
||||
--- Cr2 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.60 Desvio Padrão: 1.34
|
||||
Mediana: 0.00 IC 95%: [-1.31, 2.51]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.60 Desvio Padrão: 1.34
|
||||
Mediana: 0.00 IC 95%: [-1.31, 2.51]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 390.40 Desvio Padrão: 223.14
|
||||
Mediana: 409.00 IC 95%: [72.87, 707.93]
|
||||
Mín: 59.00 Máx: 599.00
|
||||
|
||||
|
||||
--- Cr3 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 6.20 Desvio Padrão: 8.67
|
||||
Mediana: 0.00 IC 95%: [-6.14, 18.54]
|
||||
Mín: 0.00 Máx: 18.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 6.20 Desvio Padrão: 8.67
|
||||
Mediana: 0.00 IC 95%: [-6.14, 18.54]
|
||||
Mín: 0.00 Máx: 18.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 339.00 Desvio Padrão: 239.34
|
||||
Mediana: 416.00 IC 95%: [-1.59, 679.59]
|
||||
Mín: 57.00 Máx: 622.00
|
||||
|
||||
|
||||
--- Cr4 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.60 Desvio Padrão: 0.89
|
||||
Mediana: 0.00 IC 95%: [-0.67, 1.87]
|
||||
Mín: 0.00 Máx: 2.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.60 Desvio Padrão: 0.89
|
||||
Mediana: 0.00 IC 95%: [-0.67, 1.87]
|
||||
Mín: 0.00 Máx: 2.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 123.40 Desvio Padrão: 116.13
|
||||
Mediana: 109.00 IC 95%: [-41.85, 288.65]
|
||||
Mín: 21.00 Máx: 316.00
|
||||
|
||||
|
||||
--- Cr5 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 2.40 Desvio Padrão: 1.14
|
||||
Mediana: 2.00 IC 95%: [0.78, 4.02]
|
||||
Mín: 1.00 Máx: 4.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 2.40 Desvio Padrão: 1.14
|
||||
Mediana: 2.00 IC 95%: [0.78, 4.02]
|
||||
Mín: 1.00 Máx: 4.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 200.80 Desvio Padrão: 114.19
|
||||
Mediana: 261.00 IC 95%: [38.31, 363.29]
|
||||
Mín: 70.00 Máx: 305.00
|
||||
|
||||
|
||||
--- ExitNode ---
|
||||
Tamanho Máximo da Fila: Sem dados
|
||||
|
||||
Tamanho Médio da Fila: Sem dados
|
||||
|
||||
Veículos Processados:
|
||||
Média: 651.00 Desvio Padrão: 354.20
|
||||
Mediana: 877.00 IC 95%: [146.96, 1155.04]
|
||||
Mín: 179.00 Máx: 953.00
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
RESUMOS INDIVIDUAIS DAS EXECUÇÕES
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Execução #1 [simulation-high.properties]:
|
||||
Gerados: 1784, Completados: 877 (49.2%)
|
||||
Tempo Médio no Sistema: 64.58s
|
||||
Tempo Médio de Espera: 61.43s
|
||||
|
||||
Execução #2 [simulation-high.properties]:
|
||||
Gerados: 1782, Completados: 363 (20.4%)
|
||||
Tempo Médio no Sistema: 53.77s
|
||||
Tempo Médio de Espera: 51.01s
|
||||
|
||||
Execução #3 [simulation-high.properties]:
|
||||
Gerados: 1786, Completados: 883 (49.4%)
|
||||
Tempo Médio no Sistema: 53.09s
|
||||
Tempo Médio de Espera: 50.08s
|
||||
|
||||
Execução #4 [simulation-high.properties]:
|
||||
Gerados: 1845, Completados: 179 (9.7%)
|
||||
Tempo Médio no Sistema: 63.92s
|
||||
Tempo Médio de Espera: 60.27s
|
||||
|
||||
Execução #5 [simulation-high.properties]:
|
||||
Gerados: 1872, Completados: 953 (50.9%)
|
||||
Tempo Médio no Sistema: 65.41s
|
||||
Tempo Médio de Espera: 62.16s
|
||||
|
||||
================================================================================
|
||||
FIM DO RELATÓRIO
|
||||
================================================================================
|
||||
11
main/analysis/HIGH_LOAD_20251211-021618.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
Execução,VeículosGerados,VeículosCompletados,TaxaConclusão,TempoMédioSistema,TempoMédioEspera,TempoMínimoSistema,TempoMáximoSistema
|
||||
1,1801,1711,95.00,140.07,135.67,70.03,280.14
|
||||
2,1796,1721,95.82,143.35,139.00,71.68,286.70
|
||||
3,1834,1773,96.67,149.98,145.57,74.99,299.95
|
||||
4,1799,1527,84.88,140.39,136.20,70.19,280.77
|
||||
5,1830,1670,91.26,150.89,146.66,75.45,301.78
|
||||
6,1833,1690,92.20,139.40,135.24,69.70,278.80
|
||||
7,1822,1769,97.09,148.40,144.03,74.20,296.80
|
||||
8,1756,1487,84.68,135.16,131.01,67.58,270.32
|
||||
9,1829,1640,89.67,144.65,140.25,72.32,289.30
|
||||
10,1784,1745,97.81,151.09,146.69,75.54,302.17
|
||||
|
240
main/analysis/HIGH_LOAD_20251211-021618.txt
Normal file
@@ -0,0 +1,240 @@
|
||||
================================================================================
|
||||
ANÁLISE ESTATÍSTICA MULTI-EXECUÇÃO
|
||||
================================================================================
|
||||
Configuração: simulation-high.properties
|
||||
Número de Execuções: 10
|
||||
Data da Análise: 2025-12-11 02:16:18
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
MÉTRICAS GLOBAIS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Veículos Gerados:
|
||||
Média: 1808.40 Desvio Padrão: 25.76
|
||||
Mediana: 1811.50 IC 95%: [1787.45, 1829.35]
|
||||
Mín: 1756.00 Máx: 1834.00
|
||||
|
||||
Veículos Completados:
|
||||
Média: 1673.30 Desvio Padrão: 97.44
|
||||
Mediana: 1700.50 IC 95%: [1594.08, 1752.52]
|
||||
Mín: 1487.00 Máx: 1773.00
|
||||
|
||||
Taxa de Conclusão (%):
|
||||
Média: 92.51 Desvio Padrão: 4.86
|
||||
Mediana: 93.60 IC 95%: [88.55, 96.46]
|
||||
Mín: 84.68 Máx: 97.81
|
||||
|
||||
Tempo Médio no Sistema (segundos):
|
||||
Média: 144.34 Desvio Padrão: 5.58
|
||||
Mediana: 144.00 IC 95%: [139.80, 148.87]
|
||||
Mín: 135.16 Máx: 151.09
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 140.03 Desvio Padrão: 5.52
|
||||
Mediana: 139.62 IC 95%: [135.55, 144.52]
|
||||
Mín: 131.01 Máx: 146.69
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR TIPO DE VEÍCULO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- BIKE ---
|
||||
Contagem de Veículos:
|
||||
Média: 338.60 Desvio Padrão: 31.26
|
||||
Mediana: 342.00 IC 95%: [313.19, 364.01]
|
||||
Mín: 279.00 Máx: 377.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 140.36 Desvio Padrão: 11.64
|
||||
Mediana: 138.38 IC 95%: [130.90, 149.82]
|
||||
Mín: 121.77 Máx: 165.19
|
||||
|
||||
|
||||
--- LIGHT ---
|
||||
Contagem de Veículos:
|
||||
Média: 991.30 Desvio Padrão: 49.19
|
||||
Mediana: 1011.00 IC 95%: [951.31, 1031.29]
|
||||
Mín: 893.00 Máx: 1035.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 141.44 Desvio Padrão: 7.85
|
||||
Mediana: 143.16 IC 95%: [135.06, 147.83]
|
||||
Mín: 130.22 Máx: 151.65
|
||||
|
||||
|
||||
--- HEAVY ---
|
||||
Contagem de Veículos:
|
||||
Média: 343.40 Desvio Padrão: 29.42
|
||||
Mediana: 343.00 IC 95%: [319.48, 367.32]
|
||||
Mín: 288.00 Máx: 385.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 135.81 Desvio Padrão: 9.45
|
||||
Mediana: 134.25 IC 95%: [128.13, 143.49]
|
||||
Mín: 118.95 Máx: 149.71
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR INTERSEÇÃO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- Cr1 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.70 Desvio Padrão: 1.25
|
||||
Mediana: 0.00 IC 95%: [-0.32, 1.72]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.70 Desvio Padrão: 1.25
|
||||
Mediana: 0.00 IC 95%: [-0.32, 1.72]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 578.20 Desvio Padrão: 50.05
|
||||
Mediana: 604.00 IC 95%: [537.51, 618.89]
|
||||
Mín: 493.00 Máx: 626.00
|
||||
|
||||
|
||||
--- Cr2 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 1.40 Desvio Padrão: 2.37
|
||||
Mediana: 0.00 IC 95%: [-0.52, 3.32]
|
||||
Mín: 0.00 Máx: 6.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 1.40 Desvio Padrão: 2.37
|
||||
Mediana: 0.00 IC 95%: [-0.52, 3.32]
|
||||
Mín: 0.00 Máx: 6.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 550.30 Desvio Padrão: 50.21
|
||||
Mediana: 540.00 IC 95%: [509.48, 591.12]
|
||||
Mín: 459.00 Máx: 616.00
|
||||
|
||||
|
||||
--- Cr3 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.40 Desvio Padrão: 1.26
|
||||
Mediana: 0.00 IC 95%: [-0.63, 1.43]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.40 Desvio Padrão: 1.26
|
||||
Mediana: 0.00 IC 95%: [-0.63, 1.43]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 589.10 Desvio Padrão: 42.91
|
||||
Mediana: 595.00 IC 95%: [554.21, 623.99]
|
||||
Mín: 502.00 Máx: 671.00
|
||||
|
||||
|
||||
--- Cr4 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 1.50 Desvio Padrão: 1.58
|
||||
Mediana: 1.00 IC 95%: [0.21, 2.79]
|
||||
Mín: 0.00 Máx: 5.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 1.50 Desvio Padrão: 1.58
|
||||
Mediana: 1.00 IC 95%: [0.21, 2.79]
|
||||
Mín: 0.00 Máx: 5.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 540.10 Desvio Padrão: 52.20
|
||||
Mediana: 549.50 IC 95%: [497.66, 582.54]
|
||||
Mín: 442.00 Máx: 603.00
|
||||
|
||||
|
||||
--- Cr5 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 1.50 Desvio Padrão: 1.51
|
||||
Mediana: 1.00 IC 95%: [0.27, 2.73]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 1.50 Desvio Padrão: 1.51
|
||||
Mediana: 1.00 IC 95%: [0.27, 2.73]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 1075.10 Desvio Padrão: 78.71
|
||||
Mediana: 1064.00 IC 95%: [1011.11, 1139.09]
|
||||
Mín: 920.00 Máx: 1176.00
|
||||
|
||||
|
||||
--- ExitNode ---
|
||||
Tamanho Máximo da Fila: Sem dados
|
||||
|
||||
Tamanho Médio da Fila: Sem dados
|
||||
|
||||
Veículos Processados:
|
||||
Média: 1673.30 Desvio Padrão: 97.44
|
||||
Mediana: 1700.50 IC 95%: [1594.08, 1752.52]
|
||||
Mín: 1487.00 Máx: 1773.00
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
RESUMOS INDIVIDUAIS DAS EXECUÇÕES
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Execução #1 [simulation-high.properties]:
|
||||
Gerados: 1801, Completados: 1711 (95.0%)
|
||||
Tempo Médio no Sistema: 140.07s
|
||||
Tempo Médio de Espera: 135.67s
|
||||
|
||||
Execução #2 [simulation-high.properties]:
|
||||
Gerados: 1796, Completados: 1721 (95.8%)
|
||||
Tempo Médio no Sistema: 143.35s
|
||||
Tempo Médio de Espera: 139.00s
|
||||
|
||||
Execução #3 [simulation-high.properties]:
|
||||
Gerados: 1834, Completados: 1773 (96.7%)
|
||||
Tempo Médio no Sistema: 149.98s
|
||||
Tempo Médio de Espera: 145.57s
|
||||
|
||||
Execução #4 [simulation-high.properties]:
|
||||
Gerados: 1799, Completados: 1527 (84.9%)
|
||||
Tempo Médio no Sistema: 140.39s
|
||||
Tempo Médio de Espera: 136.20s
|
||||
|
||||
Execução #5 [simulation-high.properties]:
|
||||
Gerados: 1830, Completados: 1670 (91.3%)
|
||||
Tempo Médio no Sistema: 150.89s
|
||||
Tempo Médio de Espera: 146.66s
|
||||
|
||||
Execução #6 [simulation-high.properties]:
|
||||
Gerados: 1833, Completados: 1690 (92.2%)
|
||||
Tempo Médio no Sistema: 139.40s
|
||||
Tempo Médio de Espera: 135.24s
|
||||
|
||||
Execução #7 [simulation-high.properties]:
|
||||
Gerados: 1822, Completados: 1769 (97.1%)
|
||||
Tempo Médio no Sistema: 148.40s
|
||||
Tempo Médio de Espera: 144.03s
|
||||
|
||||
Execução #8 [simulation-high.properties]:
|
||||
Gerados: 1756, Completados: 1487 (84.7%)
|
||||
Tempo Médio no Sistema: 135.16s
|
||||
Tempo Médio de Espera: 131.01s
|
||||
|
||||
Execução #9 [simulation-high.properties]:
|
||||
Gerados: 1829, Completados: 1640 (89.7%)
|
||||
Tempo Médio no Sistema: 144.65s
|
||||
Tempo Médio de Espera: 140.25s
|
||||
|
||||
Execução #10 [simulation-high.properties]:
|
||||
Gerados: 1784, Completados: 1745 (97.8%)
|
||||
Tempo Médio no Sistema: 151.09s
|
||||
Tempo Médio de Espera: 146.69s
|
||||
|
||||
================================================================================
|
||||
FIM DO RELATÓRIO
|
||||
================================================================================
|
||||
@@ -1,6 +0,0 @@
|
||||
Execução,VeículosGerados,VeículosCompletados,TaxaConclusão,TempoMédioSistema,TempoMédioEspera,TempoMínimoSistema,TempoMáximoSistema
|
||||
1,371,187,50.40,42.28,38.65,21.14,84.57
|
||||
2,361,263,72.85,29.15,25.29,14.57,58.30
|
||||
3,368,197,53.53,38.02,33.95,19.01,76.04
|
||||
4,350,239,68.29,32.38,28.36,16.19,64.75
|
||||
5,373,212,56.84,23.36,19.96,11.68,46.73
|
||||
|
@@ -1,209 +0,0 @@
|
||||
================================================================================
|
||||
ANÁLISE ESTATÍSTICA MULTI-EXECUÇÃO
|
||||
================================================================================
|
||||
Configuração: simulation-low.properties
|
||||
Número de Execuções: 5
|
||||
Data da Análise: 2025-12-07 00:09:57
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
MÉTRICAS GLOBAIS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Veículos Gerados:
|
||||
Média: 364.60 Desvio Padrão: 9.34
|
||||
Mediana: 368.00 IC 95%: [351.30, 377.90]
|
||||
Mín: 350.00 Máx: 373.00
|
||||
|
||||
Veículos Completados:
|
||||
Média: 219.60 Desvio Padrão: 31.19
|
||||
Mediana: 212.00 IC 95%: [175.22, 263.98]
|
||||
Mín: 187.00 Máx: 263.00
|
||||
|
||||
Taxa de Conclusão (%):
|
||||
Média: 60.38 Desvio Padrão: 9.71
|
||||
Mediana: 56.84 IC 95%: [46.57, 74.20]
|
||||
Mín: 50.40 Máx: 72.85
|
||||
|
||||
Tempo Médio no Sistema (segundos):
|
||||
Média: 33.04 Desvio Padrão: 7.41
|
||||
Mediana: 32.38 IC 95%: [22.50, 43.58]
|
||||
Mín: 23.36 Máx: 42.28
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 29.24 Desvio Padrão: 7.30
|
||||
Mediana: 28.36 IC 95%: [18.85, 39.63]
|
||||
Mín: 19.96 Máx: 38.65
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR TIPO DE VEÍCULO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- BIKE ---
|
||||
Contagem de Veículos:
|
||||
Média: 41.00 Desvio Padrão: 6.96
|
||||
Mediana: 43.00 IC 95%: [31.09, 50.91]
|
||||
Mín: 33.00 Máx: 50.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 25.91 Desvio Padrão: 3.91
|
||||
Mediana: 26.98 IC 95%: [20.35, 31.47]
|
||||
Mín: 19.60 Máx: 30.06
|
||||
|
||||
|
||||
--- LIGHT ---
|
||||
Contagem de Veículos:
|
||||
Média: 134.00 Desvio Padrão: 24.07
|
||||
Mediana: 130.00 IC 95%: [99.74, 168.26]
|
||||
Mín: 104.00 Máx: 167.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 29.34 Desvio Padrão: 6.83
|
||||
Mediana: 27.89 IC 95%: [19.62, 39.06]
|
||||
Mín: 20.73 Máx: 36.42
|
||||
|
||||
|
||||
--- HEAVY ---
|
||||
Contagem de Veículos:
|
||||
Média: 44.60 Desvio Padrão: 3.44
|
||||
Mediana: 46.00 IC 95%: [39.71, 49.49]
|
||||
Mín: 40.00 Máx: 48.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 32.11 Desvio Padrão: 15.90
|
||||
Mediana: 30.74 IC 95%: [9.48, 54.74]
|
||||
Mín: 18.09 Máx: 58.73
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR INTERSEÇÃO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- Cr1 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.60 Desvio Padrão: 1.34
|
||||
Mediana: 0.00 IC 95%: [-1.31, 2.51]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.60 Desvio Padrão: 1.34
|
||||
Mediana: 0.00 IC 95%: [-1.31, 2.51]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 63.80 Desvio Padrão: 17.25
|
||||
Mediana: 57.00 IC 95%: [39.25, 88.35]
|
||||
Mín: 48.00 Máx: 91.00
|
||||
|
||||
|
||||
--- Cr2 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.80 Desvio Padrão: 1.79
|
||||
Mediana: 0.00 IC 95%: [-1.75, 3.35]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.80 Desvio Padrão: 1.79
|
||||
Mediana: 0.00 IC 95%: [-1.75, 3.35]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 56.20 Desvio Padrão: 18.51
|
||||
Mediana: 50.00 IC 95%: [29.86, 82.54]
|
||||
Mín: 35.00 Máx: 78.00
|
||||
|
||||
|
||||
--- Cr3 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 1.00 Desvio Padrão: 1.41
|
||||
Mediana: 0.00 IC 95%: [-1.01, 3.01]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 1.00 Desvio Padrão: 1.41
|
||||
Mediana: 0.00 IC 95%: [-1.01, 3.01]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 63.20 Desvio Padrão: 23.97
|
||||
Mediana: 56.00 IC 95%: [29.09, 97.31]
|
||||
Mín: 41.00 Máx: 104.00
|
||||
|
||||
|
||||
--- Cr4 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 1.80 Desvio Padrão: 2.49
|
||||
Mediana: 0.00 IC 95%: [-1.74, 5.34]
|
||||
Mín: 0.00 Máx: 5.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 1.80 Desvio Padrão: 2.49
|
||||
Mediana: 0.00 IC 95%: [-1.74, 5.34]
|
||||
Mín: 0.00 Máx: 5.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 51.00 Desvio Padrão: 16.05
|
||||
Mediana: 53.00 IC 95%: [28.16, 73.84]
|
||||
Mín: 31.00 Máx: 70.00
|
||||
|
||||
|
||||
--- Cr5 ---
|
||||
Tamanho Máximo da Fila: Sem dados
|
||||
|
||||
Tamanho Médio da Fila: Sem dados
|
||||
|
||||
Veículos Processados:
|
||||
Média: 86.60 Desvio Padrão: 34.20
|
||||
Mediana: 65.00 IC 95%: [37.94, 135.26]
|
||||
Mín: 62.00 Máx: 139.00
|
||||
|
||||
|
||||
--- ExitNode ---
|
||||
Tamanho Máximo da Fila: Sem dados
|
||||
|
||||
Tamanho Médio da Fila: Sem dados
|
||||
|
||||
Veículos Processados:
|
||||
Média: 219.60 Desvio Padrão: 31.19
|
||||
Mediana: 212.00 IC 95%: [175.22, 263.98]
|
||||
Mín: 187.00 Máx: 263.00
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
RESUMOS INDIVIDUAIS DAS EXECUÇÕES
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Execução #1 [simulation-low.properties]:
|
||||
Gerados: 371, Completados: 187 (50.4%)
|
||||
Tempo Médio no Sistema: 42.28s
|
||||
Tempo Médio de Espera: 38.65s
|
||||
|
||||
Execução #2 [simulation-low.properties]:
|
||||
Gerados: 361, Completados: 263 (72.9%)
|
||||
Tempo Médio no Sistema: 29.15s
|
||||
Tempo Médio de Espera: 25.29s
|
||||
|
||||
Execução #3 [simulation-low.properties]:
|
||||
Gerados: 368, Completados: 197 (53.5%)
|
||||
Tempo Médio no Sistema: 38.02s
|
||||
Tempo Médio de Espera: 33.95s
|
||||
|
||||
Execução #4 [simulation-low.properties]:
|
||||
Gerados: 350, Completados: 239 (68.3%)
|
||||
Tempo Médio no Sistema: 32.38s
|
||||
Tempo Médio de Espera: 28.36s
|
||||
|
||||
Execução #5 [simulation-low.properties]:
|
||||
Gerados: 373, Completados: 212 (56.8%)
|
||||
Tempo Médio no Sistema: 23.36s
|
||||
Tempo Médio de Espera: 19.96s
|
||||
|
||||
================================================================================
|
||||
FIM DO RELATÓRIO
|
||||
================================================================================
|
||||
11
main/analysis/LOW_LOAD_20251211-021249.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
Execução,VeículosGerados,VeículosCompletados,TaxaConclusão,TempoMédioSistema,TempoMédioEspera,TempoMínimoSistema,TempoMáximoSistema
|
||||
1,353,334,94.62,78.12,73.90,39.06,156.25
|
||||
2,366,359,98.09,90.80,86.56,45.40,181.60
|
||||
3,352,340,96.59,78.90,74.45,39.45,157.79
|
||||
4,362,347,95.86,69.35,64.88,34.68,138.71
|
||||
5,338,324,95.86,71.04,66.72,35.52,142.08
|
||||
6,371,366,98.65,79.54,75.17,39.77,159.09
|
||||
7,355,345,97.18,69.18,64.63,34.59,138.35
|
||||
8,364,361,99.18,79.69,75.35,39.84,159.37
|
||||
9,363,309,85.12,71.72,67.62,35.86,143.44
|
||||
10,386,376,97.41,78.78,74.30,39.39,157.56
|
||||
|
240
main/analysis/LOW_LOAD_20251211-021249.txt
Normal file
@@ -0,0 +1,240 @@
|
||||
================================================================================
|
||||
ANÁLISE ESTATÍSTICA MULTI-EXECUÇÃO
|
||||
================================================================================
|
||||
Configuração: simulation-low.properties
|
||||
Número de Execuções: 10
|
||||
Data da Análise: 2025-12-11 02:12:49
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
MÉTRICAS GLOBAIS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Veículos Gerados:
|
||||
Média: 361.00 Desvio Padrão: 12.80
|
||||
Mediana: 362.50 IC 95%: [350.60, 371.40]
|
||||
Mín: 338.00 Máx: 386.00
|
||||
|
||||
Veículos Completados:
|
||||
Média: 346.10 Desvio Padrão: 20.35
|
||||
Mediana: 346.00 IC 95%: [329.55, 362.65]
|
||||
Mín: 309.00 Máx: 376.00
|
||||
|
||||
Taxa de Conclusão (%):
|
||||
Média: 95.86 Desvio Padrão: 4.02
|
||||
Mediana: 96.89 IC 95%: [92.59, 99.12]
|
||||
Mín: 85.12 Máx: 99.18
|
||||
|
||||
Tempo Médio no Sistema (segundos):
|
||||
Média: 76.71 Desvio Padrão: 6.62
|
||||
Mediana: 78.45 IC 95%: [71.33, 82.09]
|
||||
Mín: 69.18 Máx: 90.80
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 72.36 Desvio Padrão: 6.66
|
||||
Mediana: 74.10 IC 95%: [66.95, 77.77]
|
||||
Mín: 64.63 Máx: 86.56
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR TIPO DE VEÍCULO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- BIKE ---
|
||||
Contagem de Veículos:
|
||||
Média: 69.60 Desvio Padrão: 6.69
|
||||
Mediana: 71.00 IC 95%: [64.16, 75.04]
|
||||
Mín: 58.00 Máx: 78.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 68.27 Desvio Padrão: 18.90
|
||||
Mediana: 61.61 IC 95%: [52.90, 83.64]
|
||||
Mín: 55.09 Máx: 119.43
|
||||
|
||||
|
||||
--- LIGHT ---
|
||||
Contagem de Veículos:
|
||||
Média: 204.80 Desvio Padrão: 13.91
|
||||
Mediana: 202.00 IC 95%: [193.49, 216.11]
|
||||
Mín: 185.00 Máx: 231.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 72.78 Desvio Padrão: 7.41
|
||||
Mediana: 72.59 IC 95%: [66.76, 78.80]
|
||||
Mín: 63.84 Máx: 83.07
|
||||
|
||||
|
||||
--- HEAVY ---
|
||||
Contagem de Veículos:
|
||||
Média: 71.70 Desvio Padrão: 8.33
|
||||
Mediana: 70.00 IC 95%: [64.93, 78.47]
|
||||
Mín: 60.00 Máx: 83.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 75.65 Desvio Padrão: 17.00
|
||||
Mediana: 69.72 IC 95%: [61.83, 89.47]
|
||||
Mín: 61.05 Máx: 116.12
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR INTERSEÇÃO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- Cr1 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 1.50 Desvio Padrão: 2.68
|
||||
Mediana: 0.00 IC 95%: [-0.68, 3.68]
|
||||
Mín: 0.00 Máx: 7.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 1.50 Desvio Padrão: 2.68
|
||||
Mediana: 0.00 IC 95%: [-0.68, 3.68]
|
||||
Mín: 0.00 Máx: 7.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 118.90 Desvio Padrão: 6.37
|
||||
Mediana: 119.50 IC 95%: [113.72, 124.08]
|
||||
Mín: 109.00 Máx: 127.00
|
||||
|
||||
|
||||
--- Cr2 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.80 Desvio Padrão: 1.32
|
||||
Mediana: 0.00 IC 95%: [-0.27, 1.87]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.80 Desvio Padrão: 1.32
|
||||
Mediana: 0.00 IC 95%: [-0.27, 1.87]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 118.30 Desvio Padrão: 8.82
|
||||
Mediana: 121.00 IC 95%: [111.13, 125.47]
|
||||
Mín: 104.00 Máx: 128.00
|
||||
|
||||
|
||||
--- Cr3 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.30 Desvio Padrão: 0.48
|
||||
Mediana: 0.00 IC 95%: [-0.09, 0.69]
|
||||
Mín: 0.00 Máx: 1.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.30 Desvio Padrão: 0.48
|
||||
Mediana: 0.00 IC 95%: [-0.09, 0.69]
|
||||
Mín: 0.00 Máx: 1.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 120.70 Desvio Padrão: 10.27
|
||||
Mediana: 121.50 IC 95%: [112.35, 129.05]
|
||||
Mín: 108.00 Máx: 132.00
|
||||
|
||||
|
||||
--- Cr4 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 1.20 Desvio Padrão: 1.48
|
||||
Mediana: 0.50 IC 95%: [0.00, 2.40]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 1.20 Desvio Padrão: 1.48
|
||||
Mediana: 0.50 IC 95%: [0.00, 2.40]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 111.50 Desvio Padrão: 13.71
|
||||
Mediana: 115.00 IC 95%: [100.35, 122.65]
|
||||
Mín: 79.00 Máx: 127.00
|
||||
|
||||
|
||||
--- Cr5 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 1.60 Desvio Padrão: 1.35
|
||||
Mediana: 1.00 IC 95%: [0.50, 2.70]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 1.60 Desvio Padrão: 1.35
|
||||
Mediana: 1.00 IC 95%: [0.50, 2.70]
|
||||
Mín: 0.00 Máx: 4.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 225.40 Desvio Padrão: 21.42
|
||||
Mediana: 232.50 IC 95%: [207.99, 242.81]
|
||||
Mín: 178.00 Máx: 251.00
|
||||
|
||||
|
||||
--- ExitNode ---
|
||||
Tamanho Máximo da Fila: Sem dados
|
||||
|
||||
Tamanho Médio da Fila: Sem dados
|
||||
|
||||
Veículos Processados:
|
||||
Média: 346.10 Desvio Padrão: 20.35
|
||||
Mediana: 346.00 IC 95%: [329.55, 362.65]
|
||||
Mín: 309.00 Máx: 376.00
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
RESUMOS INDIVIDUAIS DAS EXECUÇÕES
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Execução #1 [simulation-low.properties]:
|
||||
Gerados: 353, Completados: 334 (94.6%)
|
||||
Tempo Médio no Sistema: 78.12s
|
||||
Tempo Médio de Espera: 73.90s
|
||||
|
||||
Execução #2 [simulation-low.properties]:
|
||||
Gerados: 366, Completados: 359 (98.1%)
|
||||
Tempo Médio no Sistema: 90.80s
|
||||
Tempo Médio de Espera: 86.56s
|
||||
|
||||
Execução #3 [simulation-low.properties]:
|
||||
Gerados: 352, Completados: 340 (96.6%)
|
||||
Tempo Médio no Sistema: 78.90s
|
||||
Tempo Médio de Espera: 74.45s
|
||||
|
||||
Execução #4 [simulation-low.properties]:
|
||||
Gerados: 362, Completados: 347 (95.9%)
|
||||
Tempo Médio no Sistema: 69.35s
|
||||
Tempo Médio de Espera: 64.88s
|
||||
|
||||
Execução #5 [simulation-low.properties]:
|
||||
Gerados: 338, Completados: 324 (95.9%)
|
||||
Tempo Médio no Sistema: 71.04s
|
||||
Tempo Médio de Espera: 66.72s
|
||||
|
||||
Execução #6 [simulation-low.properties]:
|
||||
Gerados: 371, Completados: 366 (98.7%)
|
||||
Tempo Médio no Sistema: 79.54s
|
||||
Tempo Médio de Espera: 75.17s
|
||||
|
||||
Execução #7 [simulation-low.properties]:
|
||||
Gerados: 355, Completados: 345 (97.2%)
|
||||
Tempo Médio no Sistema: 69.18s
|
||||
Tempo Médio de Espera: 64.63s
|
||||
|
||||
Execução #8 [simulation-low.properties]:
|
||||
Gerados: 364, Completados: 361 (99.2%)
|
||||
Tempo Médio no Sistema: 79.69s
|
||||
Tempo Médio de Espera: 75.35s
|
||||
|
||||
Execução #9 [simulation-low.properties]:
|
||||
Gerados: 363, Completados: 309 (85.1%)
|
||||
Tempo Médio no Sistema: 71.72s
|
||||
Tempo Médio de Espera: 67.62s
|
||||
|
||||
Execução #10 [simulation-low.properties]:
|
||||
Gerados: 386, Completados: 376 (97.4%)
|
||||
Tempo Médio no Sistema: 78.78s
|
||||
Tempo Médio de Espera: 74.30s
|
||||
|
||||
================================================================================
|
||||
FIM DO RELATÓRIO
|
||||
================================================================================
|
||||
@@ -1,6 +0,0 @@
|
||||
Execução,VeículosGerados,VeículosCompletados,TaxaConclusão,TempoMédioSistema,TempoMédioEspera,TempoMínimoSistema,TempoMáximoSistema
|
||||
1,950,416,43.79,49.34,45.70,24.67,98.68
|
||||
2,886,480,54.18,35.08,31.69,17.54,70.16
|
||||
3,954,535,56.08,43.76,40.30,21.88,87.51
|
||||
4,948,354,37.34,41.68,37.96,20.84,83.37
|
||||
5,898,312,34.74,52.56,49.26,26.28,105.13
|
||||
|
@@ -1,203 +0,0 @@
|
||||
================================================================================
|
||||
ANÁLISE ESTATÍSTICA MULTI-EXECUÇÃO
|
||||
================================================================================
|
||||
Configuração: simulation-medium.properties
|
||||
Número de Execuções: 5
|
||||
Data da Análise: 2025-12-07 00:10:34
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
MÉTRICAS GLOBAIS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Veículos Gerados:
|
||||
Média: 927.20 Desvio Padrão: 32.48
|
||||
Mediana: 948.00 IC 95%: [880.97, 973.43]
|
||||
Mín: 886.00 Máx: 954.00
|
||||
|
||||
Veículos Completados:
|
||||
Média: 419.40 Desvio Padrão: 90.64
|
||||
Mediana: 416.00 IC 95%: [290.42, 548.38]
|
||||
Mín: 312.00 Máx: 535.00
|
||||
|
||||
Taxa de Conclusão (%):
|
||||
Média: 45.23 Desvio Padrão: 9.64
|
||||
Mediana: 43.79 IC 95%: [31.50, 58.95]
|
||||
Mín: 34.74 Máx: 56.08
|
||||
|
||||
Tempo Médio no Sistema (segundos):
|
||||
Média: 44.48 Desvio Padrão: 6.81
|
||||
Mediana: 43.76 IC 95%: [34.79, 54.18]
|
||||
Mín: 35.08 Máx: 52.56
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 40.98 Desvio Padrão: 6.83
|
||||
Mediana: 40.30 IC 95%: [31.26, 50.71]
|
||||
Mín: 31.69 Máx: 49.26
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR TIPO DE VEÍCULO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- BIKE ---
|
||||
Contagem de Veículos:
|
||||
Média: 75.80 Desvio Padrão: 15.96
|
||||
Mediana: 71.00 IC 95%: [53.09, 98.51]
|
||||
Mín: 56.00 Máx: 95.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 42.34 Desvio Padrão: 10.81
|
||||
Mediana: 39.70 IC 95%: [26.96, 57.72]
|
||||
Mín: 31.96 Máx: 55.19
|
||||
|
||||
|
||||
--- LIGHT ---
|
||||
Contagem de Veículos:
|
||||
Média: 263.20 Desvio Padrão: 58.29
|
||||
Mediana: 265.00 IC 95%: [180.25, 346.15]
|
||||
Mín: 204.00 Máx: 344.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 39.13 Desvio Padrão: 6.35
|
||||
Mediana: 38.08 IC 95%: [30.09, 48.17]
|
||||
Mín: 30.47 Máx: 47.99
|
||||
|
||||
|
||||
--- HEAVY ---
|
||||
Contagem de Veículos:
|
||||
Média: 80.40 Desvio Padrão: 19.11
|
||||
Mediana: 80.00 IC 95%: [53.20, 107.60]
|
||||
Mín: 52.00 Máx: 102.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 48.02 Desvio Padrão: 30.99
|
||||
Mediana: 34.44 IC 95%: [3.92, 92.11]
|
||||
Mín: 32.46 Máx: 103.40
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR INTERSEÇÃO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- Cr1 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 5.60 Desvio Padrão: 11.44
|
||||
Mediana: 0.00 IC 95%: [-10.67, 21.87]
|
||||
Mín: 0.00 Máx: 26.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 5.60 Desvio Padrão: 11.44
|
||||
Mediana: 0.00 IC 95%: [-10.67, 21.87]
|
||||
Mín: 0.00 Máx: 26.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 156.00 Desvio Padrão: 122.81
|
||||
Mediana: 98.00 IC 95%: [-18.76, 330.76]
|
||||
Mín: 35.00 Máx: 306.00
|
||||
|
||||
|
||||
--- Cr2 ---
|
||||
Tamanho Máximo da Fila: Sem dados
|
||||
|
||||
Tamanho Médio da Fila: Sem dados
|
||||
|
||||
Veículos Processados:
|
||||
Média: 172.00 Desvio Padrão: 121.88
|
||||
Mediana: 116.00 IC 95%: [-1.44, 345.44]
|
||||
Mín: 66.00 Máx: 322.00
|
||||
|
||||
|
||||
--- Cr3 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.60 Desvio Padrão: 1.34
|
||||
Mediana: 0.00 IC 95%: [-1.31, 2.51]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.60 Desvio Padrão: 1.34
|
||||
Mediana: 0.00 IC 95%: [-1.31, 2.51]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 168.40 Desvio Padrão: 133.38
|
||||
Mediana: 121.00 IC 95%: [-21.40, 358.20]
|
||||
Mín: 48.00 Máx: 326.00
|
||||
|
||||
|
||||
--- Cr4 ---
|
||||
Tamanho Máximo da Fila: Sem dados
|
||||
|
||||
Tamanho Médio da Fila: Sem dados
|
||||
|
||||
Veículos Processados:
|
||||
Média: 71.80 Desvio Padrão: 20.39
|
||||
Mediana: 77.00 IC 95%: [42.79, 100.81]
|
||||
Mín: 38.00 Máx: 92.00
|
||||
|
||||
|
||||
--- Cr5 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 3.60 Desvio Padrão: 3.85
|
||||
Mediana: 2.00 IC 95%: [-1.87, 9.07]
|
||||
Mín: 0.00 Máx: 10.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 3.60 Desvio Padrão: 3.85
|
||||
Mediana: 2.00 IC 95%: [-1.87, 9.07]
|
||||
Mín: 0.00 Máx: 10.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 150.60 Desvio Padrão: 43.37
|
||||
Mediana: 126.00 IC 95%: [88.88, 212.32]
|
||||
Mín: 116.00 Máx: 209.00
|
||||
|
||||
|
||||
--- ExitNode ---
|
||||
Tamanho Máximo da Fila: Sem dados
|
||||
|
||||
Tamanho Médio da Fila: Sem dados
|
||||
|
||||
Veículos Processados:
|
||||
Média: 419.40 Desvio Padrão: 90.64
|
||||
Mediana: 416.00 IC 95%: [290.42, 548.38]
|
||||
Mín: 312.00 Máx: 535.00
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
RESUMOS INDIVIDUAIS DAS EXECUÇÕES
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Execução #1 [simulation-medium.properties]:
|
||||
Gerados: 950, Completados: 416 (43.8%)
|
||||
Tempo Médio no Sistema: 49.34s
|
||||
Tempo Médio de Espera: 45.70s
|
||||
|
||||
Execução #2 [simulation-medium.properties]:
|
||||
Gerados: 886, Completados: 480 (54.2%)
|
||||
Tempo Médio no Sistema: 35.08s
|
||||
Tempo Médio de Espera: 31.69s
|
||||
|
||||
Execução #3 [simulation-medium.properties]:
|
||||
Gerados: 954, Completados: 535 (56.1%)
|
||||
Tempo Médio no Sistema: 43.76s
|
||||
Tempo Médio de Espera: 40.30s
|
||||
|
||||
Execução #4 [simulation-medium.properties]:
|
||||
Gerados: 948, Completados: 354 (37.3%)
|
||||
Tempo Médio no Sistema: 41.68s
|
||||
Tempo Médio de Espera: 37.96s
|
||||
|
||||
Execução #5 [simulation-medium.properties]:
|
||||
Gerados: 898, Completados: 312 (34.7%)
|
||||
Tempo Médio no Sistema: 52.56s
|
||||
Tempo Médio de Espera: 49.26s
|
||||
|
||||
================================================================================
|
||||
FIM DO RELATÓRIO
|
||||
================================================================================
|
||||
11
main/analysis/MEDIUM_LOAD_20251211-021429.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
Execução,VeículosGerados,VeículosCompletados,TaxaConclusão,TempoMédioSistema,TempoMédioEspera,TempoMínimoSistema,TempoMáximoSistema
|
||||
1,923,887,96.10,100.39,96.03,50.19,200.77
|
||||
2,858,577,67.25,98.33,94.50,49.16,196.66
|
||||
3,873,832,95.30,101.24,96.81,50.62,202.47
|
||||
4,898,844,93.99,95.70,91.31,47.85,191.40
|
||||
5,862,697,80.86,91.12,87.17,45.56,182.24
|
||||
6,881,785,89.10,120.88,116.38,60.44,241.76
|
||||
7,948,901,95.04,99.22,94.72,49.61,198.43
|
||||
8,873,621,71.13,97.97,93.93,48.99,195.94
|
||||
9,848,807,95.17,94.44,90.15,47.22,188.88
|
||||
10,927,880,94.93,103.89,99.48,51.95,207.78
|
||||
|
240
main/analysis/MEDIUM_LOAD_20251211-021429.txt
Normal file
@@ -0,0 +1,240 @@
|
||||
================================================================================
|
||||
ANÁLISE ESTATÍSTICA MULTI-EXECUÇÃO
|
||||
================================================================================
|
||||
Configuração: simulation-medium.properties
|
||||
Número de Execuções: 10
|
||||
Data da Análise: 2025-12-11 02:14:29
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
MÉTRICAS GLOBAIS
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Veículos Gerados:
|
||||
Média: 889.10 Desvio Padrão: 33.51
|
||||
Mediana: 877.00 IC 95%: [861.85, 916.35]
|
||||
Mín: 848.00 Máx: 948.00
|
||||
|
||||
Veículos Completados:
|
||||
Média: 783.10 Desvio Padrão: 113.98
|
||||
Mediana: 819.50 IC 95%: [690.43, 875.77]
|
||||
Mín: 577.00 Máx: 901.00
|
||||
|
||||
Taxa de Conclusão (%):
|
||||
Média: 87.89 Desvio Padrão: 10.91
|
||||
Mediana: 94.46 IC 95%: [79.02, 96.76]
|
||||
Mín: 67.25 Máx: 96.10
|
||||
|
||||
Tempo Médio no Sistema (segundos):
|
||||
Média: 100.32 Desvio Padrão: 8.08
|
||||
Mediana: 98.77 IC 95%: [93.75, 106.89]
|
||||
Mín: 91.12 Máx: 120.88
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 96.05 Desvio Padrão: 7.96
|
||||
Mediana: 94.61 IC 95%: [89.58, 102.52]
|
||||
Mín: 87.17 Máx: 116.38
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR TIPO DE VEÍCULO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- BIKE ---
|
||||
Contagem de Veículos:
|
||||
Média: 157.20 Desvio Padrão: 23.74
|
||||
Mediana: 163.50 IC 95%: [137.90, 176.50]
|
||||
Mín: 113.00 Máx: 183.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 98.61 Desvio Padrão: 15.54
|
||||
Mediana: 97.14 IC 95%: [85.98, 111.24]
|
||||
Mín: 81.15 Máx: 135.92
|
||||
|
||||
|
||||
--- LIGHT ---
|
||||
Contagem de Veículos:
|
||||
Média: 469.20 Desvio Padrão: 67.33
|
||||
Mediana: 491.00 IC 95%: [414.46, 523.94]
|
||||
Mín: 336.00 Máx: 539.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 94.53 Desvio Padrão: 11.74
|
||||
Mediana: 93.58 IC 95%: [84.98, 104.08]
|
||||
Mín: 78.21 Máx: 120.14
|
||||
|
||||
|
||||
--- HEAVY ---
|
||||
Contagem de Veículos:
|
||||
Média: 156.70 Desvio Padrão: 27.98
|
||||
Mediana: 167.50 IC 95%: [133.95, 179.45]
|
||||
Mín: 117.00 Máx: 192.00
|
||||
|
||||
Tempo Médio no Sistema (segundos): Sem dados
|
||||
|
||||
Tempo Médio de Espera (segundos):
|
||||
Média: 98.43 Desvio Padrão: 8.24
|
||||
Mediana: 98.39 IC 95%: [91.73, 105.13]
|
||||
Mín: 84.28 Máx: 111.64
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ANÁLISE POR INTERSEÇÃO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- Cr1 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.50 Desvio Padrão: 1.08
|
||||
Mediana: 0.00 IC 95%: [-0.38, 1.38]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.50 Desvio Padrão: 1.08
|
||||
Mediana: 0.00 IC 95%: [-0.38, 1.38]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 290.40 Desvio Padrão: 33.98
|
||||
Mediana: 300.50 IC 95%: [262.77, 318.03]
|
||||
Mín: 224.00 Máx: 337.00
|
||||
|
||||
|
||||
--- Cr2 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 2.80 Desvio Padrão: 5.47
|
||||
Mediana: 0.00 IC 95%: [-1.65, 7.25]
|
||||
Mín: 0.00 Máx: 15.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 2.80 Desvio Padrão: 5.47
|
||||
Mediana: 0.00 IC 95%: [-1.65, 7.25]
|
||||
Mín: 0.00 Máx: 15.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 281.70 Desvio Padrão: 23.73
|
||||
Mediana: 284.50 IC 95%: [262.41, 300.99]
|
||||
Mín: 245.00 Máx: 323.00
|
||||
|
||||
|
||||
--- Cr3 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 0.30 Desvio Padrão: 0.48
|
||||
Mediana: 0.00 IC 95%: [-0.09, 0.69]
|
||||
Mín: 0.00 Máx: 1.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 0.30 Desvio Padrão: 0.48
|
||||
Mediana: 0.00 IC 95%: [-0.09, 0.69]
|
||||
Mín: 0.00 Máx: 1.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 277.30 Desvio Padrão: 27.14
|
||||
Mediana: 280.50 IC 95%: [255.24, 299.36]
|
||||
Mín: 220.00 Máx: 314.00
|
||||
|
||||
|
||||
--- Cr4 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 1.60 Desvio Padrão: 1.07
|
||||
Mediana: 2.00 IC 95%: [0.73, 2.47]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 1.60 Desvio Padrão: 1.07
|
||||
Mediana: 2.00 IC 95%: [0.73, 2.47]
|
||||
Mín: 0.00 Máx: 3.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 272.80 Desvio Padrão: 31.86
|
||||
Mediana: 274.50 IC 95%: [246.90, 298.70]
|
||||
Mín: 204.00 Máx: 324.00
|
||||
|
||||
|
||||
--- Cr5 ---
|
||||
Tamanho Máximo da Fila:
|
||||
Média: 2.70 Desvio Padrão: 2.45
|
||||
Mediana: 2.00 IC 95%: [0.71, 4.69]
|
||||
Mín: 0.00 Máx: 8.00
|
||||
|
||||
Tamanho Médio da Fila:
|
||||
Média: 2.70 Desvio Padrão: 2.45
|
||||
Mediana: 2.00 IC 95%: [0.71, 4.69]
|
||||
Mín: 0.00 Máx: 8.00
|
||||
|
||||
Veículos Processados:
|
||||
Média: 532.80 Desvio Padrão: 56.13
|
||||
Mediana: 538.00 IC 95%: [487.17, 578.43]
|
||||
Mín: 407.00 Máx: 615.00
|
||||
|
||||
|
||||
--- ExitNode ---
|
||||
Tamanho Máximo da Fila: Sem dados
|
||||
|
||||
Tamanho Médio da Fila: Sem dados
|
||||
|
||||
Veículos Processados:
|
||||
Média: 783.10 Desvio Padrão: 113.98
|
||||
Mediana: 819.50 IC 95%: [690.43, 875.77]
|
||||
Mín: 577.00 Máx: 901.00
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
RESUMOS INDIVIDUAIS DAS EXECUÇÕES
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Execução #1 [simulation-medium.properties]:
|
||||
Gerados: 923, Completados: 887 (96.1%)
|
||||
Tempo Médio no Sistema: 100.39s
|
||||
Tempo Médio de Espera: 96.03s
|
||||
|
||||
Execução #2 [simulation-medium.properties]:
|
||||
Gerados: 858, Completados: 577 (67.2%)
|
||||
Tempo Médio no Sistema: 98.33s
|
||||
Tempo Médio de Espera: 94.50s
|
||||
|
||||
Execução #3 [simulation-medium.properties]:
|
||||
Gerados: 873, Completados: 832 (95.3%)
|
||||
Tempo Médio no Sistema: 101.24s
|
||||
Tempo Médio de Espera: 96.81s
|
||||
|
||||
Execução #4 [simulation-medium.properties]:
|
||||
Gerados: 898, Completados: 844 (94.0%)
|
||||
Tempo Médio no Sistema: 95.70s
|
||||
Tempo Médio de Espera: 91.31s
|
||||
|
||||
Execução #5 [simulation-medium.properties]:
|
||||
Gerados: 862, Completados: 697 (80.9%)
|
||||
Tempo Médio no Sistema: 91.12s
|
||||
Tempo Médio de Espera: 87.17s
|
||||
|
||||
Execução #6 [simulation-medium.properties]:
|
||||
Gerados: 881, Completados: 785 (89.1%)
|
||||
Tempo Médio no Sistema: 120.88s
|
||||
Tempo Médio de Espera: 116.38s
|
||||
|
||||
Execução #7 [simulation-medium.properties]:
|
||||
Gerados: 948, Completados: 901 (95.0%)
|
||||
Tempo Médio no Sistema: 99.22s
|
||||
Tempo Médio de Espera: 94.72s
|
||||
|
||||
Execução #8 [simulation-medium.properties]:
|
||||
Gerados: 873, Completados: 621 (71.1%)
|
||||
Tempo Médio no Sistema: 97.97s
|
||||
Tempo Médio de Espera: 93.93s
|
||||
|
||||
Execução #9 [simulation-medium.properties]:
|
||||
Gerados: 848, Completados: 807 (95.2%)
|
||||
Tempo Médio no Sistema: 94.44s
|
||||
Tempo Médio de Espera: 90.15s
|
||||
|
||||
Execução #10 [simulation-medium.properties]:
|
||||
Gerados: 927, Completados: 880 (94.9%)
|
||||
Tempo Médio no Sistema: 103.89s
|
||||
Tempo Médio de Espera: 99.48s
|
||||
|
||||
================================================================================
|
||||
FIM DO RELATÓRIO
|
||||
================================================================================
|
||||
@@ -41,10 +41,10 @@ dwelling_times = [
|
||||
medium['TempoMédioSistema'].mean(),
|
||||
high['TempoMédioSistema'].mean()
|
||||
]
|
||||
plt.bar(['Low', 'Medium', 'High'], dwelling_times, color=['green', 'orange', 'red'])
|
||||
plt.ylabel('Average Dwelling Time (s)')
|
||||
plt.title('System Performance vs Load')
|
||||
plt.xlabel('Load Scenario')
|
||||
plt.bar(['Baixa', 'Média', 'Alta'], dwelling_times, color=['green', 'orange', 'red'])
|
||||
plt.ylabel('Tempo Médio no Sistema (s)')
|
||||
plt.title('Desempenho do Sistema vs Carga')
|
||||
plt.xlabel('Cenário de Carga')
|
||||
plt.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(dwelling_times):
|
||||
plt.text(i, v + 1, f'{v:.2f}s', ha='center', va='bottom')
|
||||
@@ -59,10 +59,10 @@ completion_rates = [
|
||||
medium['TaxaConclusão'].mean(),
|
||||
high['TaxaConclusão'].mean()
|
||||
]
|
||||
plt.bar(['Low', 'Medium', 'High'], completion_rates, color=['green', 'orange', 'red'])
|
||||
plt.ylabel('Completion Rate (%)')
|
||||
plt.title('Vehicle Completion Rate vs Load')
|
||||
plt.xlabel('Load Scenario')
|
||||
plt.bar(['Baixa', 'Média', 'Alta'], completion_rates, color=['green', 'orange', 'red'])
|
||||
plt.ylabel('Taxa de Conclusão (%)')
|
||||
plt.title('Taxa de Conclusão de Veículos vs Carga')
|
||||
plt.xlabel('Cenário de Carga')
|
||||
plt.grid(axis='y', alpha=0.3)
|
||||
plt.ylim(0, 100)
|
||||
for i, v in enumerate(completion_rates):
|
||||
@@ -78,10 +78,10 @@ waiting_times = [
|
||||
medium['TempoMédioEspera'].mean(),
|
||||
high['TempoMédioEspera'].mean()
|
||||
]
|
||||
plt.bar(['Low', 'Medium', 'High'], waiting_times, color=['green', 'orange', 'red'])
|
||||
plt.ylabel('Average Waiting Time (s)')
|
||||
plt.title('Average Waiting Time vs Load')
|
||||
plt.xlabel('Load Scenario')
|
||||
plt.bar(['Baixa', 'Média', 'Alta'], waiting_times, color=['green', 'orange', 'red'])
|
||||
plt.ylabel('Tempo Médio de Espera (s)')
|
||||
plt.title('Tempo Médio de Espera vs Carga')
|
||||
plt.xlabel('Cenário de Carga')
|
||||
plt.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(waiting_times):
|
||||
plt.text(i, v + 1, f'{v:.2f}s', ha='center', va='bottom')
|
||||
@@ -91,44 +91,44 @@ plt.close()
|
||||
|
||||
# 4. Gráfico: Summary Statistics
|
||||
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(14, 10))
|
||||
loads = ['Low', 'Medium', 'High']
|
||||
loads = ['Baixa', 'Média', 'Alta']
|
||||
|
||||
# Vehicles generated
|
||||
ax1.bar(loads, [low['VeículosGerados'].mean(), medium['VeículosGerados'].mean(), high['VeículosGerados'].mean()], color=['green', 'orange', 'red'])
|
||||
ax1.set_title('Vehicles Generated')
|
||||
ax1.set_ylabel('Count')
|
||||
ax1.set_title('Veículos Gerados')
|
||||
ax1.set_ylabel('Quantidade')
|
||||
ax1.grid(axis='y', alpha=0.3)
|
||||
|
||||
# Vehicles completed
|
||||
ax2.bar(loads, [low['VeículosCompletados'].mean(), medium['VeículosCompletados'].mean(), high['VeículosCompletados'].mean()], color=['green', 'orange', 'red'])
|
||||
ax2.set_title('Vehicles Completed')
|
||||
ax2.set_ylabel('Count')
|
||||
ax2.set_title('Veículos Concluídos')
|
||||
ax2.set_ylabel('Quantidade')
|
||||
ax2.grid(axis='y', alpha=0.3)
|
||||
|
||||
# Min/Max dwelling time
|
||||
x = range(3)
|
||||
width = 0.35
|
||||
ax3.bar([i - width/2 for i in x], [low['TempoMínimoSistema'].mean(), medium['TempoMínimoSistema'].mean(), high['TempoMínimoSistema'].mean()], width, label='Min', color='lightblue')
|
||||
ax3.bar([i + width/2 for i in x], [low['TempoMáximoSistema'].mean(), medium['TempoMáximoSistema'].mean(), high['TempoMáximoSistema'].mean()], width, label='Max', color='darkblue')
|
||||
ax3.set_title('Min/Max Dwelling Time')
|
||||
ax3.set_ylabel('Time (s)')
|
||||
ax3.bar([i - width/2 for i in x], [low['TempoMínimoSistema'].mean(), medium['TempoMínimoSistema'].mean(), high['TempoMínimoSistema'].mean()], width, label='Mín', color='lightblue')
|
||||
ax3.bar([i + width/2 for i in x], [low['TempoMáximoSistema'].mean(), medium['TempoMáximoSistema'].mean(), high['TempoMáximoSistema'].mean()], width, label='Máx', color='darkblue')
|
||||
ax3.set_title('Tempo no Sistema Mín/Máx')
|
||||
ax3.set_ylabel('Tempo (s)')
|
||||
ax3.set_xticks(x)
|
||||
ax3.set_xticklabels(loads)
|
||||
ax3.legend()
|
||||
ax3.grid(axis='y', alpha=0.3)
|
||||
|
||||
# Performance summary
|
||||
metrics = ['Dwelling\nTime', 'Waiting\nTime', 'Completion\nRate']
|
||||
metrics = ['Tempo no\nSistema', 'Tempo de\nEspera', 'Taxa de\nConclusão']
|
||||
low_vals = [low['TempoMédioSistema'].mean(), low['TempoMédioEspera'].mean(), low['TaxaConclusão'].mean()]
|
||||
med_vals = [medium['TempoMédioSistema'].mean(), medium['TempoMédioEspera'].mean(), medium['TaxaConclusão'].mean()]
|
||||
high_vals = [high['TempoMédioSistema'].mean(), high['TempoMédioEspera'].mean(), high['TaxaConclusão'].mean()]
|
||||
|
||||
x = range(len(metrics))
|
||||
width = 0.25
|
||||
ax4.bar([i - width for i in x], low_vals, width, label='Low', color='green')
|
||||
ax4.bar(x, med_vals, width, label='Medium', color='orange')
|
||||
ax4.bar([i + width for i in x], high_vals, width, label='High', color='red')
|
||||
ax4.set_title('Performance Summary')
|
||||
ax4.bar([i - width for i in x], low_vals, width, label='Baixa', color='green')
|
||||
ax4.bar(x, med_vals, width, label='Média', color='orange')
|
||||
ax4.bar([i + width for i in x], high_vals, width, label='Alta', color='red')
|
||||
ax4.set_title('Resumo de Desempenho')
|
||||
ax4.set_xticks(x)
|
||||
ax4.set_xticklabels(metrics)
|
||||
ax4.legend()
|
||||
|
||||
365
main/graphing_all.py
Normal file
@@ -0,0 +1,365 @@
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import glob
|
||||
import os
|
||||
|
||||
# Find CSV files using glob
|
||||
def load_latest_csv(pattern):
|
||||
"""Load the most recent CSV file matching the pattern"""
|
||||
files = glob.glob(pattern)
|
||||
if not files:
|
||||
print(f"Aviso: Nenhum ficheiro encontrado com o padrão '{pattern}'")
|
||||
return None
|
||||
# Sort by modification time, get the latest
|
||||
latest_file = max(files, key=os.path.getmtime)
|
||||
print(f"A carregar: {latest_file}")
|
||||
return pd.read_csv(latest_file)
|
||||
|
||||
print("="*60)
|
||||
print("ANÁLISE COMPLETA DE SIMULAÇÃO")
|
||||
print("="*60)
|
||||
|
||||
# Carregar todos os dados
|
||||
print("\nA procurar ficheiros de análise...")
|
||||
low = load_latest_csv('analysis/LOW_LOAD_*.csv')
|
||||
medium = load_latest_csv('analysis/MEDIUM_LOAD_*.csv')
|
||||
high = load_latest_csv('analysis/HIGH_LOAD_*.csv')
|
||||
|
||||
# Check if we have all data
|
||||
if low is None or medium is None or high is None:
|
||||
print("\nErro: Ficheiros de análise em falta!")
|
||||
print("Por favor execute a análise batch primeiro.")
|
||||
exit(1)
|
||||
|
||||
# Create output directory for graphs
|
||||
os.makedirs('graphs', exist_ok=True)
|
||||
|
||||
# Determine the run column name (could be 'Run' or 'Execução')
|
||||
run_col = 'Run' if 'Run' in low.columns else 'Execução'
|
||||
|
||||
print(f"\nColunas disponíveis: {low.columns.tolist()}")
|
||||
|
||||
# ==============================================================================
|
||||
# GRÁFICOS COMPARATIVOS (entre cargas)
|
||||
# ==============================================================================
|
||||
|
||||
print("\n" + "="*60)
|
||||
print("A GERAR GRÁFICOS COMPARATIVOS")
|
||||
print("="*60)
|
||||
|
||||
# 1. Gráfico: Dwelling Time vs Load
|
||||
plt.figure(figsize=(10, 6))
|
||||
dwelling_times = [
|
||||
low['TempoMédioSistema'].mean(),
|
||||
medium['TempoMédioSistema'].mean(),
|
||||
high['TempoMédioSistema'].mean()
|
||||
]
|
||||
plt.bar(['Baixa', 'Média', 'Alta'], dwelling_times, color=['green', 'orange', 'red'])
|
||||
plt.ylabel('Tempo Médio no Sistema (s)')
|
||||
plt.title('Desempenho do Sistema vs Carga')
|
||||
plt.xlabel('Cenário de Carga')
|
||||
plt.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(dwelling_times):
|
||||
plt.text(i, v + 1, f'{v:.2f}s', ha='center', va='bottom')
|
||||
plt.savefig('graphs/dwelling_time_comparison.png', dpi=300, bbox_inches='tight')
|
||||
print("Gráfico guardado: graphs/dwelling_time_comparison.png")
|
||||
plt.close()
|
||||
|
||||
# 2. Gráfico: Completion Rate vs Load
|
||||
plt.figure(figsize=(10, 6))
|
||||
completion_rates = [
|
||||
low['TaxaConclusão'].mean(),
|
||||
medium['TaxaConclusão'].mean(),
|
||||
high['TaxaConclusão'].mean()
|
||||
]
|
||||
plt.bar(['Baixa', 'Média', 'Alta'], completion_rates, color=['green', 'orange', 'red'])
|
||||
plt.ylabel('Taxa de Conclusão (%)')
|
||||
plt.title('Taxa de Conclusão de Veículos vs Carga')
|
||||
plt.xlabel('Cenário de Carga')
|
||||
plt.grid(axis='y', alpha=0.3)
|
||||
plt.ylim(0, 100)
|
||||
for i, v in enumerate(completion_rates):
|
||||
plt.text(i, v + 2, f'{v:.1f}%', ha='center', va='bottom')
|
||||
plt.savefig('graphs/completion_rate_comparison.png', dpi=300, bbox_inches='tight')
|
||||
print("Gráfico guardado: graphs/completion_rate_comparison.png")
|
||||
plt.close()
|
||||
|
||||
# 3. Gráfico: Waiting Time vs Load
|
||||
plt.figure(figsize=(10, 6))
|
||||
waiting_times = [
|
||||
low['TempoMédioEspera'].mean(),
|
||||
medium['TempoMédioEspera'].mean(),
|
||||
high['TempoMédioEspera'].mean()
|
||||
]
|
||||
plt.bar(['Baixa', 'Média', 'Alta'], waiting_times, color=['green', 'orange', 'red'])
|
||||
plt.ylabel('Tempo Médio de Espera (s)')
|
||||
plt.title('Tempo Médio de Espera vs Carga')
|
||||
plt.xlabel('Cenário de Carga')
|
||||
plt.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(waiting_times):
|
||||
plt.text(i, v + 1, f'{v:.2f}s', ha='center', va='bottom')
|
||||
plt.savefig('graphs/waiting_time_comparison.png', dpi=300, bbox_inches='tight')
|
||||
print("Gráfico guardado: graphs/waiting_time_comparison.png")
|
||||
plt.close()
|
||||
|
||||
# 4. Gráfico: Summary Statistics (comparativo)
|
||||
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(14, 10))
|
||||
loads = ['Baixa', 'Média', 'Alta']
|
||||
|
||||
# Vehicles generated
|
||||
ax1.bar(loads, [low['VeículosGerados'].mean(), medium['VeículosGerados'].mean(), high['VeículosGerados'].mean()], color=['green', 'orange', 'red'])
|
||||
ax1.set_title('Veículos Gerados')
|
||||
ax1.set_ylabel('Quantidade')
|
||||
ax1.grid(axis='y', alpha=0.3)
|
||||
|
||||
# Vehicles completed
|
||||
ax2.bar(loads, [low['VeículosCompletados'].mean(), medium['VeículosCompletados'].mean(), high['VeículosCompletados'].mean()], color=['green', 'orange', 'red'])
|
||||
ax2.set_title('Veículos Concluídos')
|
||||
ax2.set_ylabel('Quantidade')
|
||||
ax2.grid(axis='y', alpha=0.3)
|
||||
|
||||
# Min/Max dwelling time
|
||||
x = range(3)
|
||||
width = 0.35
|
||||
ax3.bar([i - width/2 for i in x], [low['TempoMínimoSistema'].mean(), medium['TempoMínimoSistema'].mean(), high['TempoMínimoSistema'].mean()], width, label='Mín', color='lightblue')
|
||||
ax3.bar([i + width/2 for i in x], [low['TempoMáximoSistema'].mean(), medium['TempoMáximoSistema'].mean(), high['TempoMáximoSistema'].mean()], width, label='Máx', color='darkblue')
|
||||
ax3.set_title('Tempo no Sistema Mín/Máx')
|
||||
ax3.set_ylabel('Tempo (s)')
|
||||
ax3.set_xticks(x)
|
||||
ax3.set_xticklabels(loads)
|
||||
ax3.legend()
|
||||
ax3.grid(axis='y', alpha=0.3)
|
||||
|
||||
# Performance summary
|
||||
metrics = ['Tempo no\nSistema', 'Tempo de\nEspera', 'Taxa de\nConclusão']
|
||||
low_vals = [low['TempoMédioSistema'].mean(), low['TempoMédioEspera'].mean(), low['TaxaConclusão'].mean()]
|
||||
med_vals = [medium['TempoMédioSistema'].mean(), medium['TempoMédioEspera'].mean(), medium['TaxaConclusão'].mean()]
|
||||
high_vals = [high['TempoMédioSistema'].mean(), high['TempoMédioEspera'].mean(), high['TaxaConclusão'].mean()]
|
||||
|
||||
x = range(len(metrics))
|
||||
width = 0.25
|
||||
ax4.bar([i - width for i in x], low_vals, width, label='Baixa', color='green')
|
||||
ax4.bar(x, med_vals, width, label='Média', color='orange')
|
||||
ax4.bar([i + width for i in x], high_vals, width, label='Alta', color='red')
|
||||
ax4.set_title('Resumo de Desempenho')
|
||||
ax4.set_xticks(x)
|
||||
ax4.set_xticklabels(metrics)
|
||||
ax4.legend()
|
||||
ax4.grid(axis='y', alpha=0.3)
|
||||
|
||||
plt.tight_layout()
|
||||
plt.savefig('graphs/summary_statistics.png', dpi=300, bbox_inches='tight')
|
||||
print("Gráfico guardado: graphs/summary_statistics.png")
|
||||
plt.close()
|
||||
|
||||
# ==============================================================================
|
||||
# GRÁFICOS INDIVIDUAIS POR CARGA
|
||||
# ==============================================================================
|
||||
|
||||
def generate_individual_graphs(data, load_type, load_name, color):
|
||||
"""Generate detailed graphs for a specific load type"""
|
||||
|
||||
print(f"\n{'='*60}")
|
||||
print(f"A GERAR GRÁFICOS - CARGA {load_name.upper()}")
|
||||
print("="*60)
|
||||
|
||||
# 1. Gráfico: Run-by-Run Dwelling Time
|
||||
plt.figure(figsize=(12, 6))
|
||||
plt.plot(data[run_col], data['TempoMédioSistema'], marker='o', color=color, linewidth=2, markersize=6)
|
||||
plt.fill_between(data[run_col], data['TempoMínimoSistema'], data['TempoMáximoSistema'], alpha=0.2, color=color)
|
||||
plt.ylabel('Tempo no Sistema (s)')
|
||||
plt.xlabel('Número da Execução')
|
||||
plt.title(f'Tempo no Sistema por Execução - Carga {load_name}')
|
||||
plt.grid(alpha=0.3)
|
||||
plt.legend(['Média', 'Intervalo Min-Max'])
|
||||
plt.savefig(f'graphs/{load_type.lower()}_dwelling_time_runs.png', dpi=300, bbox_inches='tight')
|
||||
print(f"Gráfico guardado: graphs/{load_type.lower()}_dwelling_time_runs.png")
|
||||
plt.close()
|
||||
|
||||
# 2. Gráfico: Run-by-Run Completion Rate
|
||||
plt.figure(figsize=(12, 6))
|
||||
plt.plot(data[run_col], data['TaxaConclusão'], marker='o', color=color, linewidth=2, markersize=6)
|
||||
plt.axhline(y=data['TaxaConclusão'].mean(), color='black', linestyle='--', label=f'Média: {data["TaxaConclusão"].mean():.1f}%')
|
||||
plt.ylabel('Taxa de Conclusão (%)')
|
||||
plt.xlabel('Número da Execução')
|
||||
plt.title(f'Taxa de Conclusão por Execução - Carga {load_name}')
|
||||
plt.ylim(0, 105)
|
||||
plt.grid(alpha=0.3)
|
||||
plt.legend()
|
||||
plt.savefig(f'graphs/{load_type.lower()}_completion_rate_runs.png', dpi=300, bbox_inches='tight')
|
||||
print(f"Gráfico guardado: graphs/{load_type.lower()}_completion_rate_runs.png")
|
||||
plt.close()
|
||||
|
||||
# 3. Gráfico: Run-by-Run Waiting Time
|
||||
plt.figure(figsize=(12, 6))
|
||||
plt.plot(data[run_col], data['TempoMédioEspera'], marker='o', color=color, linewidth=2, markersize=6)
|
||||
plt.ylabel('Tempo de Espera (s)')
|
||||
plt.xlabel('Número da Execução')
|
||||
plt.title(f'Tempo Médio de Espera por Execução - Carga {load_name}')
|
||||
plt.grid(alpha=0.3)
|
||||
plt.savefig(f'graphs/{load_type.lower()}_waiting_time_runs.png', dpi=300, bbox_inches='tight')
|
||||
print(f"Gráfico guardado: graphs/{load_type.lower()}_waiting_time_runs.png")
|
||||
plt.close()
|
||||
|
||||
# 4. Gráfico: Vehicles Generated vs Completed
|
||||
plt.figure(figsize=(10, 6))
|
||||
x = range(len(data))
|
||||
width = 0.35
|
||||
plt.bar([i - width/2 for i in x], data['VeículosGerados'], width, label='Gerados', color='lightblue', alpha=0.8)
|
||||
plt.bar([i + width/2 for i in x], data['VeículosCompletados'], width, label='Concluídos', color=color, alpha=0.8)
|
||||
plt.ylabel('Número de Veículos')
|
||||
plt.xlabel('Número da Execução')
|
||||
plt.title(f'Veículos Gerados vs Concluídos - Carga {load_name}')
|
||||
plt.xticks(x, data[run_col])
|
||||
plt.legend()
|
||||
plt.grid(axis='y', alpha=0.3)
|
||||
plt.savefig(f'graphs/{load_type.lower()}_vehicles_comparison.png', dpi=300, bbox_inches='tight')
|
||||
print(f"Gráfico guardado: graphs/{load_type.lower()}_vehicles_comparison.png")
|
||||
plt.close()
|
||||
|
||||
# 5. Gráfico: Summary Statistics (4-panel)
|
||||
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(14, 10))
|
||||
|
||||
# Panel 1: Dwelling Time Statistics
|
||||
metrics = ['Média', 'Mínimo', 'Máximo', 'Desvio\nPadrão']
|
||||
values = [
|
||||
data['TempoMédioSistema'].mean(),
|
||||
data['TempoMínimoSistema'].min(),
|
||||
data['TempoMáximoSistema'].max(),
|
||||
data['TempoMédioSistema'].std()
|
||||
]
|
||||
ax1.bar(metrics, values, color=[color, 'lightblue', 'darkblue', 'gray'])
|
||||
ax1.set_title('Estatísticas de Tempo no Sistema')
|
||||
ax1.set_ylabel('Tempo (s)')
|
||||
ax1.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(values):
|
||||
ax1.text(i, v + 0.5, f'{v:.2f}s', ha='center', va='bottom')
|
||||
|
||||
# Panel 2: Waiting Time Statistics
|
||||
values = [
|
||||
data['TempoMédioEspera'].mean(),
|
||||
data['TempoMédioEspera'].min(),
|
||||
data['TempoMédioEspera'].max(),
|
||||
data['TempoMédioEspera'].std()
|
||||
]
|
||||
ax2.bar(metrics, values, color=[color, 'lightblue', 'darkblue', 'gray'])
|
||||
ax2.set_title('Estatísticas de Tempo de Espera')
|
||||
ax2.set_ylabel('Tempo (s)')
|
||||
ax2.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(values):
|
||||
ax2.text(i, v + 0.5, f'{v:.2f}s', ha='center', va='bottom')
|
||||
|
||||
# Panel 3: Completion Rate Distribution
|
||||
ax3.hist(data['TaxaConclusão'], bins=10, color=color, alpha=0.7, edgecolor='black')
|
||||
ax3.axvline(data['TaxaConclusão'].mean(), color='red', linestyle='--', linewidth=2, label='Média')
|
||||
ax3.set_title('Distribuição da Taxa de Conclusão')
|
||||
ax3.set_xlabel('Taxa de Conclusão (%)')
|
||||
ax3.set_ylabel('Frequência')
|
||||
ax3.legend()
|
||||
ax3.grid(axis='y', alpha=0.3)
|
||||
|
||||
# Panel 4: Key Metrics Summary
|
||||
summary_metrics = ['Veículos\nGerados', 'Veículos\nConcluídos', 'Taxa de\nConclusão (%)']
|
||||
summary_values = [
|
||||
data['VeículosGerados'].mean(),
|
||||
data['VeículosCompletados'].mean(),
|
||||
data['TaxaConclusão'].mean()
|
||||
]
|
||||
# Create bars individually with different alpha values
|
||||
alphas = [0.5, 0.7, 0.9]
|
||||
for i, (metric, value, alpha_val) in enumerate(zip(summary_metrics, summary_values, alphas)):
|
||||
ax4.bar(i, value, color=color, alpha=alpha_val)
|
||||
ax4.set_xticks(range(len(summary_metrics)))
|
||||
ax4.set_xticklabels(summary_metrics)
|
||||
ax4.set_title('Resumo de Métricas-Chave')
|
||||
ax4.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(summary_values):
|
||||
ax4.text(i, v + max(summary_values)*0.02, f'{v:.1f}', ha='center', va='bottom', fontweight='bold')
|
||||
|
||||
plt.tight_layout()
|
||||
plt.savefig(f'graphs/{load_type.lower()}_summary_statistics.png', dpi=300, bbox_inches='tight')
|
||||
print(f"Gráfico guardado: graphs/{load_type.lower()}_summary_statistics.png")
|
||||
plt.close()
|
||||
|
||||
# Print detailed summary statistics
|
||||
print(f"\n{'='*60}")
|
||||
print(f"CARGA {load_name.upper()} - ESTATÍSTICAS DETALHADAS")
|
||||
print("="*60)
|
||||
|
||||
print(f"\nTEMPO NO SISTEMA:")
|
||||
print(f" Média: {data['TempoMédioSistema'].mean():.2f}s")
|
||||
print(f" Desvio Padrão: {data['TempoMédioSistema'].std():.2f}s")
|
||||
print(f" Mínimo: {data['TempoMínimoSistema'].min():.2f}s")
|
||||
print(f" Máximo: {data['TempoMáximoSistema'].max():.2f}s")
|
||||
print(f" Mediana: {data['TempoMédioSistema'].median():.2f}s")
|
||||
|
||||
print(f"\nTEMPO DE ESPERA:")
|
||||
print(f" Média: {data['TempoMédioEspera'].mean():.2f}s")
|
||||
print(f" Desvio Padrão: {data['TempoMédioEspera'].std():.2f}s")
|
||||
print(f" Mínimo: {data['TempoMédioEspera'].min():.2f}s")
|
||||
print(f" Máximo: {data['TempoMédioEspera'].max():.2f}s")
|
||||
print(f" Mediana: {data['TempoMédioEspera'].median():.2f}s")
|
||||
|
||||
print(f"\nTAXA DE CONCLUSÃO:")
|
||||
print(f" Média: {data['TaxaConclusão'].mean():.2f}%")
|
||||
print(f" Desvio Padrão: {data['TaxaConclusão'].std():.2f}%")
|
||||
print(f" Mínimo: {data['TaxaConclusão'].min():.2f}%")
|
||||
print(f" Máximo: {data['TaxaConclusão'].max():.2f}%")
|
||||
print(f" Mediana: {data['TaxaConclusão'].median():.2f}%")
|
||||
|
||||
print(f"\nCONTAGEM DE VEÍCULOS:")
|
||||
print(f" Média Gerados: {data['VeículosGerados'].mean():.0f}")
|
||||
print(f" Média Concluídos: {data['VeículosCompletados'].mean():.0f}")
|
||||
print(f" Média Perdidos: {data['VeículosGerados'].mean() - data['VeículosCompletados'].mean():.0f}")
|
||||
|
||||
print(f"\nEXECUÇÕES ANALISADAS: {len(data)}")
|
||||
|
||||
# Check for config file column - could be ArquivoConfig or ConfigFile
|
||||
config_col = None
|
||||
if 'ArquivoConfig' in data.columns:
|
||||
config_col = 'ArquivoConfig'
|
||||
elif 'ConfigFile' in data.columns:
|
||||
config_col = 'ConfigFile'
|
||||
|
||||
if config_col:
|
||||
print(f"FICHEIRO DE CONFIGURAÇÃO: {data[config_col].iloc[0]}")
|
||||
|
||||
# Generate individual graphs for each load
|
||||
generate_individual_graphs(low, 'LOW', 'Baixa', 'green')
|
||||
generate_individual_graphs(medium, 'MEDIUM', 'Média', 'orange')
|
||||
generate_individual_graphs(high, 'HIGH', 'Alta', 'red')
|
||||
|
||||
# ==============================================================================
|
||||
# SUMÁRIO FINAL
|
||||
# ==============================================================================
|
||||
|
||||
print("\n" + "="*60)
|
||||
print("SUMÁRIO COMPARATIVO FINAL")
|
||||
print("="*60)
|
||||
|
||||
print(f"\nCARGA BAIXA:")
|
||||
print(f" Tempo Médio no Sistema: {low['TempoMédioSistema'].mean():.2f}s")
|
||||
print(f" Tempo Médio de Espera: {low['TempoMédioEspera'].mean():.2f}s")
|
||||
print(f" Taxa de Conclusão: {low['TaxaConclusão'].mean():.1f}%")
|
||||
print(f" Veículos Gerados: {low['VeículosGerados'].mean():.0f}")
|
||||
print(f" Veículos Concluídos: {low['VeículosCompletados'].mean():.0f}")
|
||||
|
||||
print(f"\nCARGA MÉDIA:")
|
||||
print(f" Tempo Médio no Sistema: {medium['TempoMédioSistema'].mean():.2f}s")
|
||||
print(f" Tempo Médio de Espera: {medium['TempoMédioEspera'].mean():.2f}s")
|
||||
print(f" Taxa de Conclusão: {medium['TaxaConclusão'].mean():.1f}%")
|
||||
print(f" Veículos Gerados: {medium['VeículosGerados'].mean():.0f}")
|
||||
print(f" Veículos Concluídos: {medium['VeículosCompletados'].mean():.0f}")
|
||||
|
||||
print(f"\nCARGA ALTA:")
|
||||
print(f" Tempo Médio no Sistema: {high['TempoMédioSistema'].mean():.2f}s")
|
||||
print(f" Tempo Médio de Espera: {high['TempoMédioEspera'].mean():.2f}s")
|
||||
print(f" Taxa de Conclusão: {high['TaxaConclusão'].mean():.1f}%")
|
||||
print(f" Veículos Gerados: {high['VeículosGerados'].mean():.0f}")
|
||||
print(f" Veículos Concluídos: {high['VeículosCompletados'].mean():.0f}")
|
||||
|
||||
print("\n" + "="*60)
|
||||
print("ANÁLISE COMPLETA!")
|
||||
print(f"Total de gráficos gerados: 19")
|
||||
print("Todos os gráficos foram guardados no diretório 'graphs/'")
|
||||
print("="*60)
|
||||
222
main/graphing_single.py
Normal file
@@ -0,0 +1,222 @@
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Find CSV files using glob
|
||||
def load_latest_csv(pattern):
|
||||
"""Load the most recent CSV file matching the pattern"""
|
||||
files = glob.glob(pattern)
|
||||
if not files:
|
||||
print(f"Warning: No files found matching '{pattern}'")
|
||||
return None
|
||||
# Sort by modification time, get the latest
|
||||
latest_file = max(files, key=os.path.getmtime)
|
||||
print(f"Loading: {latest_file}")
|
||||
return pd.read_csv(latest_file)
|
||||
|
||||
# Determine which load to analyze
|
||||
if len(sys.argv) > 1:
|
||||
load_type = sys.argv[1].upper()
|
||||
else:
|
||||
print("Usage: python graphing_single.py [LOW|MEDIUM|HIGH]")
|
||||
print("Defaulting to LOW_LOAD...")
|
||||
load_type = "LOW"
|
||||
|
||||
# Validate load type
|
||||
if load_type not in ["LOW", "MEDIUM", "HIGH"]:
|
||||
print(f"Error: Invalid load type '{load_type}'. Must be LOW, MEDIUM, or HIGH.")
|
||||
exit(1)
|
||||
|
||||
# Load the specified data
|
||||
print(f"Looking for {load_type}_LOAD analysis files...")
|
||||
pattern = f'analysis/{load_type}_LOAD_*.csv'
|
||||
data = load_latest_csv(pattern)
|
||||
|
||||
if data is None:
|
||||
print(f"\nError: No {load_type}_LOAD analysis files found!")
|
||||
print("Please run the batch analysis first.")
|
||||
exit(1)
|
||||
|
||||
# Print available columns for debugging
|
||||
print(f"\nAvailable columns in {load_type}_LOAD CSV:")
|
||||
print(data.columns.tolist())
|
||||
|
||||
# Create output directory for graphs
|
||||
os.makedirs('graphs', exist_ok=True)
|
||||
|
||||
# Determine the run column name (could be 'Run' or 'Execução')
|
||||
run_col = 'Run' if 'Run' in data.columns else 'Execução'
|
||||
|
||||
# Load name for titles
|
||||
load_name = load_type.capitalize()
|
||||
colors = {'LOW': 'green', 'MEDIUM': 'orange', 'HIGH': 'red'}
|
||||
color = colors[load_type]
|
||||
|
||||
# 1. Gráfico: Run-by-Run Dwelling Time
|
||||
plt.figure(figsize=(12, 6))
|
||||
plt.plot(data[run_col], data['TempoMédioSistema'], marker='o', color=color, linewidth=2, markersize=6)
|
||||
plt.fill_between(data[run_col], data['TempoMínimoSistema'], data['TempoMáximoSistema'], alpha=0.2, color=color)
|
||||
plt.ylabel('Tempo no Sistema (s)')
|
||||
plt.xlabel('Run Number')
|
||||
plt.title(f'Tempo no Sistema por Execução - Carga {load_name}')
|
||||
plt.grid(alpha=0.3)
|
||||
plt.legend(['Média', 'Min-Max Range'])
|
||||
plt.savefig(f'graphs/{load_type.lower()}_dwelling_time_runs.png', dpi=300, bbox_inches='tight')
|
||||
print(f"\nGraph saved: graphs/{load_type.lower()}_dwelling_time_runs.png")
|
||||
plt.close()
|
||||
|
||||
# 2. Gráfico: Run-by-Run Completion Rate
|
||||
plt.figure(figsize=(12, 6))
|
||||
plt.plot(data[run_col], data['TaxaConclusão'], marker='o', color=color, linewidth=2, markersize=6)
|
||||
plt.axhline(y=data['TaxaConclusão'].mean(), color='black', linestyle='--', label=f'Média: {data["TaxaConclusão"].mean():.1f}%')
|
||||
plt.ylabel('Taxa de Conclusão (%)')
|
||||
plt.xlabel('Run Number')
|
||||
plt.title(f'Taxa de Conclusão por Execução - Carga {load_name}')
|
||||
plt.ylim(0, 105)
|
||||
plt.grid(alpha=0.3)
|
||||
plt.legend()
|
||||
plt.savefig(f'graphs/{load_type.lower()}_completion_rate_runs.png', dpi=300, bbox_inches='tight')
|
||||
print(f"Graph saved: graphs/{load_type.lower()}_completion_rate_runs.png")
|
||||
plt.close()
|
||||
|
||||
# 3. Gráfico: Run-by-Run Waiting Time
|
||||
plt.figure(figsize=(12, 6))
|
||||
plt.plot(data[run_col], data['TempoMédioEspera'], marker='o', color=color, linewidth=2, markersize=6)
|
||||
plt.ylabel('Tempo de Espera (s)')
|
||||
plt.xlabel('Run Number')
|
||||
plt.title(f'Tempo Médio de Espera por Execução - Carga {load_name}')
|
||||
plt.grid(alpha=0.3)
|
||||
plt.savefig(f'graphs/{load_type.lower()}_waiting_time_runs.png', dpi=300, bbox_inches='tight')
|
||||
print(f"Graph saved: graphs/{load_type.lower()}_waiting_time_runs.png")
|
||||
plt.close()
|
||||
|
||||
# 4. Gráfico: Vehicles Generated vs Completed
|
||||
plt.figure(figsize=(10, 6))
|
||||
x = range(len(data))
|
||||
width = 0.35
|
||||
plt.bar([i - width/2 for i in x], data['VeículosGerados'], width, label='Gerados', color='lightblue', alpha=0.8)
|
||||
plt.bar([i + width/2 for i in x], data['VeículosCompletados'], width, label='Concluídos', color=color, alpha=0.8)
|
||||
plt.ylabel('Número de Veículos')
|
||||
plt.xlabel('Run Number')
|
||||
plt.title(f'Veículos Gerados vs Concluídos - Carga {load_name}')
|
||||
plt.xticks(x, data[run_col])
|
||||
plt.legend()
|
||||
plt.grid(axis='y', alpha=0.3)
|
||||
plt.savefig(f'graphs/{load_type.lower()}_vehicles_comparison.png', dpi=300, bbox_inches='tight')
|
||||
print(f"Graph saved: graphs/{load_type.lower()}_vehicles_comparison.png")
|
||||
plt.close()
|
||||
|
||||
# 5. Gráfico: Summary Statistics (4-panel)
|
||||
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(14, 10))
|
||||
|
||||
# Panel 1: Dwelling Time Statistics
|
||||
metrics = ['Média', 'Mínimo', 'Máximo', 'Desvio\nPadrão']
|
||||
values = [
|
||||
data['TempoMédioSistema'].mean(),
|
||||
data['TempoMínimoSistema'].min(),
|
||||
data['TempoMáximoSistema'].max(),
|
||||
data['TempoMédioSistema'].std()
|
||||
]
|
||||
ax1.bar(metrics, values, color=[color, 'lightblue', 'darkblue', 'gray'])
|
||||
ax1.set_title('Estatísticas de Tempo no Sistema')
|
||||
ax1.set_ylabel('Tempo (s)')
|
||||
ax1.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(values):
|
||||
ax1.text(i, v + 0.5, f'{v:.2f}s', ha='center', va='bottom')
|
||||
|
||||
# Panel 2: Waiting Time Statistics
|
||||
values = [
|
||||
data['TempoMédioEspera'].mean(),
|
||||
data['TempoMédioEspera'].min(),
|
||||
data['TempoMédioEspera'].max(),
|
||||
data['TempoMédioEspera'].std()
|
||||
]
|
||||
ax2.bar(metrics, values, color=[color, 'lightblue', 'darkblue', 'gray'])
|
||||
ax2.set_title('Estatísticas de Tempo de Espera')
|
||||
ax2.set_ylabel('Tempo (s)')
|
||||
ax2.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(values):
|
||||
ax2.text(i, v + 0.5, f'{v:.2f}s', ha='center', va='bottom')
|
||||
|
||||
# Panel 3: Completion Rate Distribution
|
||||
ax3.hist(data['TaxaConclusão'], bins=10, color=color, alpha=0.7, edgecolor='black')
|
||||
ax3.axvline(data['TaxaConclusão'].mean(), color='red', linestyle='--', linewidth=2, label='Média')
|
||||
ax3.set_title('Distribuição da Taxa de Conclusão')
|
||||
ax3.set_xlabel('Taxa de Conclusão (%)')
|
||||
ax3.set_ylabel('Frequência')
|
||||
ax3.legend()
|
||||
ax3.grid(axis='y', alpha=0.3)
|
||||
|
||||
# Panel 4: Key Metrics Summary
|
||||
summary_metrics = ['Veículos\nGerados', 'Veículos\nConcluídos', 'Taxa de\nConclusão (%)']
|
||||
summary_values = [
|
||||
data['VeículosGerados'].mean(),
|
||||
data['VeículosCompletados'].mean(),
|
||||
data['TaxaConclusão'].mean()
|
||||
]
|
||||
# Create bars individually with different alpha values
|
||||
alphas = [0.5, 0.7, 0.9]
|
||||
for i, (metric, value, alpha_val) in enumerate(zip(summary_metrics, summary_values, alphas)):
|
||||
ax4.bar(i, value, color=color, alpha=alpha_val)
|
||||
ax4.set_xticks(range(len(summary_metrics)))
|
||||
ax4.set_xticklabels(summary_metrics)
|
||||
ax4.set_title('Resumo de Métricas-Chave')
|
||||
ax4.grid(axis='y', alpha=0.3)
|
||||
for i, v in enumerate(summary_values):
|
||||
ax4.text(i, v + max(summary_values)*0.02, f'{v:.1f}', ha='center', va='bottom', fontweight='bold')
|
||||
|
||||
plt.tight_layout()
|
||||
plt.savefig(f'graphs/{load_type.lower()}_summary_statistics.png', dpi=300, bbox_inches='tight')
|
||||
print(f"Graph saved: graphs/{load_type.lower()}_summary_statistics.png")
|
||||
plt.close()
|
||||
|
||||
# Print detailed summary statistics
|
||||
print("\n" + "="*60)
|
||||
print(f"{load_name.upper()} LOAD - DETAILED STATISTICS")
|
||||
print("="*60)
|
||||
|
||||
print(f"\nTIME IN SYSTEM:")
|
||||
print(f" Mean: {data['TempoMédioSistema'].mean():.2f}s")
|
||||
print(f" Std Dev: {data['TempoMédioSistema'].std():.2f}s")
|
||||
print(f" Min: {data['TempoMínimoSistema'].min():.2f}s")
|
||||
print(f" Max: {data['TempoMáximoSistema'].max():.2f}s")
|
||||
print(f" Median: {data['TempoMédioSistema'].median():.2f}s")
|
||||
|
||||
print(f"\nWAITING TIME:")
|
||||
print(f" Mean: {data['TempoMédioEspera'].mean():.2f}s")
|
||||
print(f" Std Dev: {data['TempoMédioEspera'].std():.2f}s")
|
||||
print(f" Min: {data['TempoMédioEspera'].min():.2f}s")
|
||||
print(f" Max: {data['TempoMédioEspera'].max():.2f}s")
|
||||
print(f" Median: {data['TempoMédioEspera'].median():.2f}s")
|
||||
|
||||
print(f"\nCOMPLETION RATE:")
|
||||
print(f" Mean: {data['TaxaConclusão'].mean():.2f}%")
|
||||
print(f" Std Dev: {data['TaxaConclusão'].std():.2f}%")
|
||||
print(f" Min: {data['TaxaConclusão'].min():.2f}%")
|
||||
print(f" Max: {data['TaxaConclusão'].max():.2f}%")
|
||||
print(f" Median: {data['TaxaConclusão'].median():.2f}%")
|
||||
|
||||
print(f"\nVEHICLE COUNTS:")
|
||||
print(f" Mean Generated: {data['VeículosGerados'].mean():.0f}")
|
||||
print(f" Mean Completed: {data['VeículosCompletados'].mean():.0f}")
|
||||
print(f" Mean Lost: {data['VeículosGerados'].mean() - data['VeículosCompletados'].mean():.0f}")
|
||||
|
||||
print(f"\nRUNS ANALYZED: {len(data)}")
|
||||
|
||||
# Check for config file column - could be ArquivoConfig or ConfigFile
|
||||
config_col = None
|
||||
if 'ArquivoConfig' in data.columns:
|
||||
config_col = 'ArquivoConfig'
|
||||
elif 'ConfigFile' in data.columns:
|
||||
config_col = 'ConfigFile'
|
||||
|
||||
if config_col:
|
||||
print(f"CONFIGURATION FILE: {data[config_col].iloc[0]}")
|
||||
else:
|
||||
print(f"CONFIGURATION FILE: N/A")
|
||||
|
||||
print("\n" + "="*60)
|
||||
print(f"All graphs saved in 'graphs/' directory with prefix '{load_type.lower()}_'")
|
||||
print("="*60)
|
||||
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 92 KiB |
BIN
main/graphs/high_completion_rate_runs.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
main/graphs/high_dwelling_time_runs.png
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
main/graphs/high_summary_statistics.png
Normal file
|
After Width: | Height: | Size: 274 KiB |
BIN
main/graphs/high_vehicles_comparison.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
main/graphs/high_waiting_time_runs.png
Normal file
|
After Width: | Height: | Size: 173 KiB |
BIN
main/graphs/low_completion_rate_runs.png
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
main/graphs/low_dwelling_time_runs.png
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
main/graphs/low_summary_statistics.png
Normal file
|
After Width: | Height: | Size: 265 KiB |
BIN
main/graphs/low_vehicles_comparison.png
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
main/graphs/low_waiting_time_runs.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
main/graphs/medium_completion_rate_runs.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
BIN
main/graphs/medium_dwelling_time_runs.png
Normal file
|
After Width: | Height: | Size: 163 KiB |
BIN
main/graphs/medium_summary_statistics.png
Normal file
|
After Width: | Height: | Size: 254 KiB |
BIN
main/graphs/medium_vehicles_comparison.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
main/graphs/medium_waiting_time_runs.png
Normal file
|
After Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 227 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 92 KiB |
13
main/pom.xml
@@ -83,6 +83,19 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Maven Javadoc Plugin -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.12.0</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<encoding>UTF-8</encoding>
|
||||
<doclint>none</doclint>
|
||||
<failOnError>false</failOnError>
|
||||
<failOnWarnings>false</failOnWarnings>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ import sd.protocol.SocketConnection;
|
||||
*/
|
||||
public class ExitNodeProcess {
|
||||
|
||||
// --- Configuration and Networking ---
|
||||
private final SimulationConfig config;
|
||||
private ServerSocket serverSocket;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package sd.coordinator;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.LockSupport;
|
||||
|
||||
import sd.config.SimulationConfig;
|
||||
import sd.dashboard.DashboardStatistics;
|
||||
@@ -375,6 +376,7 @@ public class CoordinatorProcess {
|
||||
|
||||
String entryIntersection = vehicle.getRoute().get(0);
|
||||
sendVehicleToIntersection(vehicle, entryIntersection);
|
||||
LockSupport.parkNanos(100000); // 100us
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,10 +50,11 @@ public class ConfigurationDialog {
|
||||
// Criar painel de configuração
|
||||
VBox content = new VBox(15);
|
||||
content.setPadding(new Insets(20));
|
||||
content.setStyle("-fx-background-color: #2b2b2b;");
|
||||
|
||||
// Seção 1: Parâmetros de Chegada
|
||||
Label arrivalHeader = new Label("Parâmetros de Chegada de Veículos");
|
||||
arrivalHeader.setStyle("-fx-font-weight: bold; -fx-font-size: 14px;");
|
||||
arrivalHeader.setStyle("-fx-font-weight: bold; -fx-font-size: 14px; -fx-text-fill: white;");
|
||||
|
||||
GridPane arrivalGrid = new GridPane();
|
||||
arrivalGrid.setHgap(10);
|
||||
@@ -62,6 +63,7 @@ public class ConfigurationDialog {
|
||||
|
||||
// Modelo de chegada
|
||||
Label modelLabel = new Label("Modelo de chegada:");
|
||||
modelLabel.setStyle("-fx-text-fill: white;");
|
||||
ComboBox<String> modelCombo = new ComboBox<>();
|
||||
modelCombo.getItems().addAll("POISSON", "FIXED");
|
||||
modelCombo.setValue("POISSON");
|
||||
@@ -70,6 +72,7 @@ public class ConfigurationDialog {
|
||||
|
||||
// Taxa de chegada (λ)
|
||||
Label rateLabel = new Label("Taxa de chegada (λ) [veículos/s]:");
|
||||
rateLabel.setStyle("-fx-text-fill: white;");
|
||||
Spinner<Double> rateSpinner = new Spinner<>(0.1, 2.0, 0.5, 0.1);
|
||||
rateSpinner.setEditable(true);
|
||||
rateSpinner.setPrefWidth(100);
|
||||
@@ -78,6 +81,7 @@ public class ConfigurationDialog {
|
||||
|
||||
// Intervalo fixo (se aplicável)
|
||||
Label intervalLabel = new Label("Intervalo fixo [s]:");
|
||||
intervalLabel.setStyle("-fx-text-fill: white;");
|
||||
Spinner<Double> intervalSpinner = new Spinner<>(0.5, 10.0, 2.0, 0.5);
|
||||
intervalSpinner.setEditable(true);
|
||||
intervalSpinner.setPrefWidth(100);
|
||||
@@ -94,7 +98,7 @@ public class ConfigurationDialog {
|
||||
|
||||
// Seção 2: Parâmetros de Tempo
|
||||
Label timeHeader = new Label("Parâmetros de Tempo");
|
||||
timeHeader.setStyle("-fx-font-weight: bold; -fx-font-size: 14px;");
|
||||
timeHeader.setStyle("-fx-font-weight: bold; -fx-font-size: 14px; -fx-text-fill: white;");
|
||||
|
||||
GridPane timeGrid = new GridPane();
|
||||
timeGrid.setHgap(10);
|
||||
@@ -103,6 +107,7 @@ public class ConfigurationDialog {
|
||||
|
||||
// Duração da simulação
|
||||
Label durationLabel = new Label("Duração da simulação [s]:");
|
||||
durationLabel.setStyle("-fx-text-fill: white;");
|
||||
Spinner<Integer> durationSpinner = new Spinner<>(60, 7200, 300, 60);
|
||||
durationSpinner.setEditable(true);
|
||||
durationSpinner.setPrefWidth(100);
|
||||
@@ -111,6 +116,7 @@ public class ConfigurationDialog {
|
||||
|
||||
// Escala temporal (para visualização)
|
||||
Label scaleLabel = new Label("Escala temporal (0=instantâneo, 1=tempo real):");
|
||||
scaleLabel.setStyle("-fx-text-fill: white;");
|
||||
Spinner<Double> scaleSpinner = new Spinner<>(0.0, 1.0, 0.01, 0.01);
|
||||
scaleSpinner.setEditable(true);
|
||||
scaleSpinner.setPrefWidth(100);
|
||||
@@ -119,6 +125,7 @@ public class ConfigurationDialog {
|
||||
|
||||
// Tempo de drenagem
|
||||
Label drainLabel = new Label("Tempo de drenagem [s]:");
|
||||
drainLabel.setStyle("-fx-text-fill: white;");
|
||||
Spinner<Integer> drainSpinner = new Spinner<>(0, 300, 60, 10);
|
||||
drainSpinner.setEditable(true);
|
||||
drainSpinner.setPrefWidth(100);
|
||||
@@ -127,7 +134,7 @@ public class ConfigurationDialog {
|
||||
|
||||
// Seção 3: Distribuição de Tipos de Veículos
|
||||
Label vehicleHeader = new Label("Distribuição de Tipos de Veículos");
|
||||
vehicleHeader.setStyle("-fx-font-weight: bold; -fx-font-size: 14px;");
|
||||
vehicleHeader.setStyle("-fx-font-weight: bold; -fx-font-size: 14px; -fx-text-fill: white;");
|
||||
|
||||
GridPane vehicleGrid = new GridPane();
|
||||
vehicleGrid.setHgap(10);
|
||||
@@ -135,6 +142,7 @@ public class ConfigurationDialog {
|
||||
vehicleGrid.setPadding(new Insets(10));
|
||||
|
||||
Label bikeLabel = new Label("Bicicletas/Motos [%]:");
|
||||
bikeLabel.setStyle("-fx-text-fill: white;");
|
||||
Spinner<Integer> bikeSpinner = new Spinner<>(0, 100, 10, 5);
|
||||
bikeSpinner.setEditable(true);
|
||||
bikeSpinner.setPrefWidth(100);
|
||||
@@ -142,6 +150,7 @@ public class ConfigurationDialog {
|
||||
vehicleGrid.add(bikeSpinner, 1, 0);
|
||||
|
||||
Label lightLabel = new Label("Veículos Ligeiros [%]:");
|
||||
lightLabel.setStyle("-fx-text-fill: white;");
|
||||
Spinner<Integer> lightSpinner = new Spinner<>(0, 100, 70, 5);
|
||||
lightSpinner.setEditable(true);
|
||||
lightSpinner.setPrefWidth(100);
|
||||
@@ -149,6 +158,7 @@ public class ConfigurationDialog {
|
||||
vehicleGrid.add(lightSpinner, 1, 1);
|
||||
|
||||
Label heavyLabel = new Label("Veículos Pesados [%]:");
|
||||
heavyLabel.setStyle("-fx-text-fill: white;");
|
||||
Spinner<Integer> heavySpinner = new Spinner<>(0, 100, 20, 5);
|
||||
heavySpinner.setEditable(true);
|
||||
heavySpinner.setPrefWidth(100);
|
||||
@@ -159,7 +169,7 @@ public class ConfigurationDialog {
|
||||
Label noteLabel = new Label("Nota: Estes parâmetros sobrepõem os valores do ficheiro .properties selecionado.\n" +
|
||||
"Para usar os valores padrão do ficheiro, deixe em branco ou cancele.");
|
||||
noteLabel.setWrapText(true);
|
||||
noteLabel.setStyle("-fx-font-size: 11px; -fx-text-fill: #666666;");
|
||||
noteLabel.setStyle("-fx-font-size: 11px; -fx-text-fill: #aaaaaa;");
|
||||
|
||||
// Adicionar tudo ao conteúdo
|
||||
content.getChildren().addAll(
|
||||
|
||||
@@ -96,6 +96,7 @@ public class DashboardUI extends Application {
|
||||
// Build UI Layout
|
||||
BorderPane root = new BorderPane();
|
||||
root.getStyleClass().add("root");
|
||||
root.setStyle("-fx-background-color: #2b2b2b;");
|
||||
|
||||
// Header (Top)
|
||||
VBox header = createHeader();
|
||||
|
||||
@@ -94,9 +94,6 @@ public class Intersection {
|
||||
*/
|
||||
public void receiveVehicle(Vehicle vehicle, double simulationTime) {
|
||||
totalVehiclesReceived++;
|
||||
|
||||
// Note: Route advancement is handled by SimulationEngine.handleVehicleArrival()
|
||||
// before calling this method, so we don't advance here.
|
||||
|
||||
String nextDestination = vehicle.getCurrentDestination();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package sd.protocol;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import sd.model.MessageType; // Assuming MessageType is in sd.model or sd.protocol
|
||||
import sd.model.MessageType;
|
||||
|
||||
/**
|
||||
* Contrato para todas as mensagens trocadas no simulador.
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.net.Socket;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.LockSupport;
|
||||
|
||||
import sd.serialization.MessageSerializer;
|
||||
import sd.serialization.SerializationException;
|
||||
@@ -30,9 +31,30 @@ import sd.serialization.SerializerFactory;
|
||||
*/
|
||||
public class SocketConnection implements Closeable {
|
||||
|
||||
// --- Network Resources ---
|
||||
|
||||
/**
|
||||
* The underlying TCP socket used for network communication.
|
||||
*/
|
||||
private final Socket socket;
|
||||
|
||||
/**
|
||||
* The raw output stream for writing bytes to the network.
|
||||
* Wrapped by {@link DataOutputStream} during message sending.
|
||||
*/
|
||||
private final OutputStream outputStream;
|
||||
|
||||
/**
|
||||
* The raw input stream for reading bytes from the network.
|
||||
* Wrapped by {@link DataInputStream} during message reception.
|
||||
*/
|
||||
private final InputStream inputStream;
|
||||
|
||||
// --- Serialization ---
|
||||
|
||||
/**
|
||||
* The serializer strategy used to convert objects to/from byte arrays (e.g., JSON).
|
||||
*/
|
||||
private final MessageSerializer serializer;
|
||||
|
||||
/** Número máximo de tentativas de ligação antes de desistir (Fail-fast). */
|
||||
@@ -146,7 +168,8 @@ public class SocketConnection implements Closeable {
|
||||
DataOutputStream dataOut = new DataOutputStream(outputStream);
|
||||
dataOut.writeInt(data.length);
|
||||
dataOut.write(data);
|
||||
dataOut.flush(); // Force transmission immediately
|
||||
dataOut.flush();
|
||||
LockSupport.parkNanos(50000); // 50us
|
||||
|
||||
} catch (SerializationException e) {
|
||||
throw new IOException("Failed to serialize message", e);
|
||||
@@ -169,7 +192,7 @@ public class SocketConnection implements Closeable {
|
||||
}
|
||||
|
||||
try {
|
||||
// Lê um prefixo de 4 bytes - indicador de tamanho
|
||||
|
||||
DataInputStream dataIn = new DataInputStream(inputStream);
|
||||
int length = dataIn.readInt();
|
||||
|
||||
@@ -181,6 +204,7 @@ public class SocketConnection implements Closeable {
|
||||
// Ler dados exatos da mensagem
|
||||
byte[] data = new byte[length];
|
||||
dataIn.readFully(data);
|
||||
LockSupport.parkNanos(50000); // 50us
|
||||
|
||||
// Deserialize do JSON - força o tipo concreto Message
|
||||
return serializer.deserialize(data, sd.model.Message.class);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Global Styles */
|
||||
.root {
|
||||
-fx-background-color: #f4f7f6;
|
||||
-fx-background-color: #2b2b2b;
|
||||
-fx-font-family: 'Segoe UI', sans-serif;
|
||||
}
|
||||
|
||||
@@ -63,24 +63,24 @@
|
||||
|
||||
/* Cards / Panels */
|
||||
.card {
|
||||
-fx-background-color: white;
|
||||
-fx-background-color: #1e1e1e;
|
||||
-fx-background-radius: 8;
|
||||
-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.05), 10, 0, 0, 2);
|
||||
-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.3), 10, 0, 0, 2);
|
||||
-fx-padding: 0;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
-fx-background-color: #ecf0f1;
|
||||
-fx-background-color: #3a3a3a;
|
||||
-fx-background-radius: 8 8 0 0;
|
||||
-fx-padding: 10 15;
|
||||
-fx-border-color: #bdc3c7;
|
||||
-fx-border-color: #555555;
|
||||
-fx-border-width: 0 0 1 0;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
-fx-font-size: 16px;
|
||||
-fx-font-weight: bold;
|
||||
-fx-text-fill: #2c3e50;
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
|
||||
.card-content {
|
||||
@@ -90,43 +90,48 @@
|
||||
/* Statistics Grid */
|
||||
.stat-label {
|
||||
-fx-font-size: 14px;
|
||||
-fx-text-fill: #7f8c8d;
|
||||
-fx-text-fill: #cccccc;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
-fx-font-size: 20px;
|
||||
-fx-font-weight: bold;
|
||||
-fx-text-fill: #2980b9;
|
||||
-fx-text-fill: #4ca1af;
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
.table-view {
|
||||
-fx-background-color: transparent;
|
||||
-fx-background-color: #1e1e1e;
|
||||
-fx-border-color: transparent;
|
||||
}
|
||||
|
||||
.table-view .column-header-background {
|
||||
-fx-background-color: #ecf0f1;
|
||||
-fx-border-color: #bdc3c7;
|
||||
-fx-background-color: #3a3a3a;
|
||||
-fx-border-color: #555555;
|
||||
-fx-border-width: 0 0 1 0;
|
||||
}
|
||||
|
||||
.table-view .column-header .label {
|
||||
-fx-text-fill: #2c3e50;
|
||||
-fx-text-fill: white;
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
.table-row-cell {
|
||||
-fx-background-color: white;
|
||||
-fx-background-color: #1e1e1e;
|
||||
-fx-border-color: transparent;
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
|
||||
.table-row-cell:odd {
|
||||
-fx-background-color: #f9f9f9;
|
||||
-fx-background-color: #252525;
|
||||
}
|
||||
|
||||
.table-row-cell:selected {
|
||||
-fx-background-color: #3498db;
|
||||
-fx-background-color: #4ca1af;
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
|
||||
.table-cell {
|
||||
-fx-text-fill: white;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
# =========================================================
|
||||
# Traffic Simulation Configuration - HIGH LOAD SCENARIO
|
||||
# ---------------------------------------------------------
|
||||
# High traffic scenario for testing system under heavy load.
|
||||
# Expected: Significant congestion, large queues, system stress test
|
||||
# =========================================================
|
||||
|
||||
# === NETWORK CONFIGURATION ===
|
||||
|
||||
# Intersections (each with its host and port)
|
||||
# Configuração de rede
|
||||
intersection.Cr1.host=localhost
|
||||
intersection.Cr1.port=8001
|
||||
intersection.Cr2.host=localhost
|
||||
@@ -19,67 +10,48 @@ intersection.Cr4.port=8004
|
||||
intersection.Cr5.host=localhost
|
||||
intersection.Cr5.port=8005
|
||||
|
||||
# Exit node
|
||||
exit.host=localhost
|
||||
exit.port=9001
|
||||
|
||||
# Dashboard server
|
||||
dashboard.host=localhost
|
||||
dashboard.port=9000
|
||||
|
||||
|
||||
# === SIMULATION CONFIGURATION ===
|
||||
|
||||
# Total duration in seconds (1800 = 30 minutes)
|
||||
# Configuração da simulação
|
||||
# Cenário de carga alta - tráfego pesado, teste de stress do sistema
|
||||
simulation.duration=1800
|
||||
|
||||
# Vehicle arrival model: FIXED or POISSON
|
||||
simulation.arrival.model=POISSON
|
||||
|
||||
# λ (lambda): HIGH LOAD = 1.0 vehicle per second (60 vehicles/minute, 3600 vehicles/hour)
|
||||
# This is 2x medium load - tests system capacity limits
|
||||
simulation.arrival.rate=1.0
|
||||
|
||||
# Fixed interval between arrivals (only used if model=FIXED)
|
||||
simulation.arrival.fixed.interval=2.0
|
||||
|
||||
# Routing policy: RANDOM, SHORTEST_PATH, LEAST_CONGESTED
|
||||
simulation.routing.policy=LEAST_CONGESTED
|
||||
|
||||
# Tempos dos semáforos (tempos realistas do mundo real, sem fase amarela)
|
||||
# Cruzamento 1 - ponto de entrada, verde mais longo
|
||||
trafficlight.Cr1.South.green=45.0
|
||||
trafficlight.Cr1.South.red=45.0
|
||||
trafficlight.Cr1.East.green=45.0
|
||||
trafficlight.Cr1.East.red=45.0
|
||||
|
||||
# === TRAFFIC LIGHT TIMINGS ===
|
||||
# Format: trafficlight.<intersection>.<direction>.<state>=<seconds>
|
||||
# Aggressive timings to maximize throughput under high load
|
||||
# Cruzamento 2 - hub principal, gargalo crítico, tempos máximos de verde
|
||||
trafficlight.Cr2.South.green=50.0
|
||||
trafficlight.Cr2.South.red=50.0
|
||||
trafficlight.Cr2.East.green=60.0
|
||||
trafficlight.Cr2.East.red=40.0
|
||||
trafficlight.Cr2.West.green=50.0
|
||||
trafficlight.Cr2.West.red=50.0
|
||||
|
||||
# Intersection 1 (Entry point - longer greens to prevent early backup)
|
||||
trafficlight.Cr1.South.green=60.0
|
||||
trafficlight.Cr1.South.red=3.0
|
||||
trafficlight.Cr1.East.green=60.0
|
||||
trafficlight.Cr1.East.red=3.0
|
||||
# Cruzamento 3 - caminho para a saída
|
||||
trafficlight.Cr3.South.green=40.0
|
||||
trafficlight.Cr3.South.red=45.0
|
||||
trafficlight.Cr3.West.green=45.0
|
||||
trafficlight.Cr3.West.red=40.0
|
||||
|
||||
# Intersection 2 (Main hub - CRITICAL BOTTLENECK, maximum green times)
|
||||
# This is the most critical intersection - all routes converge here
|
||||
trafficlight.Cr2.South.green=70.0
|
||||
trafficlight.Cr2.South.red=3.0
|
||||
trafficlight.Cr2.East.green=80.0
|
||||
trafficlight.Cr2.East.red=3.0
|
||||
trafficlight.Cr2.West.green=70.0
|
||||
trafficlight.Cr2.West.red=3.0
|
||||
# Cruzamento 4
|
||||
trafficlight.Cr4.East.green=45.0
|
||||
trafficlight.Cr4.East.red=45.0
|
||||
trafficlight.Cr4.North.green=45.0
|
||||
trafficlight.Cr4.North.red=45.0
|
||||
|
||||
# Intersection 3 (Path to exit - maximize East throughput to exit)
|
||||
trafficlight.Cr3.South.green=50.0
|
||||
trafficlight.Cr3.South.red=3.0
|
||||
trafficlight.Cr3.West.green=40.0
|
||||
trafficlight.Cr3.West.red=3.0
|
||||
|
||||
# Intersection 4 (High throughput needed toward Cr5)
|
||||
trafficlight.Cr4.East.green=70.0
|
||||
trafficlight.Cr4.East.red=3.0
|
||||
trafficlight.Cr4.North.green=70.0
|
||||
trafficlight.Cr4.North.red=3.0
|
||||
|
||||
# Intersection 5 (Near exit - MAJOR BOTTLENECK, longest green time)
|
||||
# All routes funnel through here before exit
|
||||
# Cruzamento 5 - perto da saída, gargalo principal
|
||||
trafficlight.Cr5.East.green=90.0
|
||||
trafficlight.Cr5.East.red=3.0
|
||||
trafficlight.Cr5.West.green=70.0
|
||||
@@ -87,40 +59,17 @@ trafficlight.Cr5.West.red=3.0
|
||||
trafficlight.Cr5.North.green=70.0
|
||||
trafficlight.Cr5.North.red=3.0
|
||||
|
||||
|
||||
# === VEHICLE CONFIGURATION ===
|
||||
# Probability distribution for vehicle types (must sum to 1.0)
|
||||
# Configuração de veículos
|
||||
vehicle.probability.bike=0.2
|
||||
vehicle.probability.light=0.6
|
||||
vehicle.probability.heavy=0.2
|
||||
|
||||
# Average crossing times (in seconds)
|
||||
vehicle.crossing.time.bike=1.0
|
||||
vehicle.crossing.time.light=2.0
|
||||
vehicle.crossing.time.heavy=4.0
|
||||
|
||||
# Travel times between intersections (in seconds)
|
||||
# Base time for light vehicles (cars)
|
||||
vehicle.travel.time.base=1.0
|
||||
# Bike travel time = 0.5 x car travel time
|
||||
vehicle.travel.time.bike.multiplier=0.5
|
||||
# Heavy vehicle travel time = 4.0 x base travel time
|
||||
vehicle.travel.time.heavy.multiplier=4.0
|
||||
|
||||
# === STATISTICS ===
|
||||
|
||||
# Interval between dashboard updates (seconds)
|
||||
statistics.update.interval=10.0
|
||||
|
||||
# === EXPECTED BEHAVIOR - HIGH LOAD ===
|
||||
# - Average system time: 200-400+ seconds (3-7+ minutes)
|
||||
# - Maximum queue sizes: 15-30+ vehicles at Cr2 and Cr5
|
||||
# - Average queue sizes: 8-15+ vehicles
|
||||
# - Severe congestion at Cr2 (main convergence point)
|
||||
# - Severe congestion at Cr5 (pre-exit bottleneck)
|
||||
# - System utilization: ~80-95%
|
||||
# - Many vehicles will remain in system at simulation end
|
||||
# - Queue growth may be unbounded if arrival rate exceeds service rate
|
||||
# - Primary bottlenecks: Cr2 (3-way convergence) and Cr5 (final funnel)
|
||||
# - This scenario tests maximum system capacity and traffic light optimization
|
||||
# - Expected to demonstrate need for adaptive traffic light policies
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
# =========================================================
|
||||
# Traffic Simulation Configuration - LOW LOAD SCENARIO
|
||||
# ---------------------------------------------------------
|
||||
# Low traffic scenario for testing system under light load.
|
||||
# Expected: No congestion, minimal queues, fast vehicle throughput
|
||||
# =========================================================
|
||||
|
||||
# === NETWORK CONFIGURATION ===
|
||||
|
||||
# Intersections (each with its host and port)
|
||||
# Configuração de rede
|
||||
intersection.Cr1.host=localhost
|
||||
intersection.Cr1.port=8001
|
||||
intersection.Cr2.host=localhost
|
||||
@@ -19,65 +10,48 @@ intersection.Cr4.port=8004
|
||||
intersection.Cr5.host=localhost
|
||||
intersection.Cr5.port=8005
|
||||
|
||||
# Exit node
|
||||
exit.host=localhost
|
||||
exit.port=9001
|
||||
|
||||
# Dashboard server
|
||||
dashboard.host=localhost
|
||||
dashboard.port=9000
|
||||
|
||||
|
||||
# === SIMULATION CONFIGURATION ===
|
||||
|
||||
# Total duration in seconds (1800 = 30 minutes)
|
||||
# Configuração da simulação
|
||||
# Cenário de carga baixa - tráfego leve para testar o sistema sem congestionamento
|
||||
simulation.duration=1800
|
||||
|
||||
# Vehicle arrival model: FIXED or POISSON
|
||||
simulation.arrival.model=POISSON
|
||||
|
||||
# λ (lambda): LOW LOAD = 0.2 vehicles per second (12 vehicles/minute, 720 vehicles/hour)
|
||||
# This is approximately 40% of medium load
|
||||
simulation.arrival.rate=0.2
|
||||
|
||||
# Fixed interval between arrivals (only used if model=FIXED)
|
||||
simulation.arrival.fixed.interval=2.0
|
||||
|
||||
# Routing policy: RANDOM, SHORTEST_PATH, LEAST_CONGESTED
|
||||
simulation.routing.policy=LEAST_CONGESTED
|
||||
|
||||
|
||||
# === TRAFFIC LIGHT TIMINGS ===
|
||||
# Format: trafficlight.<intersection>.<direction>.<state>=<seconds>
|
||||
# Standard timings - should be more than adequate for low load
|
||||
|
||||
# Intersection 1 (Entry point - balanced)
|
||||
# Tempos dos semáforos (tempos realistas do mundo real, sem fase amarela)
|
||||
# Cruzamento 1 - ponto de entrada, equilibrado
|
||||
trafficlight.Cr1.South.green=30.0
|
||||
trafficlight.Cr1.South.red=5.0
|
||||
trafficlight.Cr1.South.red=30.0
|
||||
trafficlight.Cr1.East.green=30.0
|
||||
trafficlight.Cr1.East.red=5.0
|
||||
trafficlight.Cr1.East.red=30.0
|
||||
|
||||
# Intersection 2 (Main hub - shorter cycles, favor East-West)
|
||||
# Cruzamento 2 - hub principal
|
||||
trafficlight.Cr2.South.green=30.0
|
||||
trafficlight.Cr2.South.red=5.0
|
||||
trafficlight.Cr2.South.red=30.0
|
||||
trafficlight.Cr2.East.green=30.0
|
||||
trafficlight.Cr2.East.red=5.0
|
||||
trafficlight.Cr2.East.red=30.0
|
||||
trafficlight.Cr2.West.green=30.0
|
||||
trafficlight.Cr2.West.red=5.0
|
||||
trafficlight.Cr2.West.red=30.0
|
||||
|
||||
# Intersection 3 (Path to exit - favor East)
|
||||
# Cruzamento 3 - caminho para a saída
|
||||
trafficlight.Cr3.South.green=30.0
|
||||
trafficlight.Cr3.South.red=5.0
|
||||
trafficlight.Cr3.South.red=30.0
|
||||
trafficlight.Cr3.West.green=30.0
|
||||
trafficlight.Cr3.West.red=5.0
|
||||
trafficlight.Cr3.West.red=30.0
|
||||
|
||||
# Intersection 4 (Favor East toward Cr5)
|
||||
# Cruzamento 4
|
||||
trafficlight.Cr4.East.green=30.0
|
||||
trafficlight.Cr4.East.red=5.0
|
||||
trafficlight.Cr4.East.red=30.0
|
||||
trafficlight.Cr4.North.green=30.0
|
||||
trafficlight.Cr4.North.red=5.0
|
||||
trafficlight.Cr4.North.red=30.0
|
||||
|
||||
# Intersection 5 (Near exit - favor East)
|
||||
# Cruzamento 5 - perto da saída
|
||||
trafficlight.Cr5.East.green=30.0
|
||||
trafficlight.Cr5.East.red=5.0
|
||||
trafficlight.Cr5.West.green=30.0
|
||||
@@ -85,36 +59,17 @@ trafficlight.Cr5.West.red=5.0
|
||||
trafficlight.Cr5.North.green=30.0
|
||||
trafficlight.Cr5.North.red=5.0
|
||||
|
||||
|
||||
# === VEHICLE CONFIGURATION ===
|
||||
# Probability distribution for vehicle types (must sum to 1.0)
|
||||
# Configuração de veículos
|
||||
vehicle.probability.bike=0.2
|
||||
vehicle.probability.light=0.6
|
||||
vehicle.probability.heavy=0.2
|
||||
|
||||
# Average crossing times (in seconds)
|
||||
vehicle.crossing.time.bike=1.0
|
||||
vehicle.crossing.time.light=2.0
|
||||
vehicle.crossing.time.heavy=4.0
|
||||
|
||||
# Travel times between intersections (in seconds)
|
||||
# Base time for light vehicles (cars)
|
||||
vehicle.travel.time.base=1.0
|
||||
# Bike travel time = 0.5 x car travel time
|
||||
vehicle.travel.time.bike.multiplier=0.5
|
||||
# Heavy vehicle travel time = 4.0 x base travel time
|
||||
vehicle.travel.time.heavy.multiplier=4.0
|
||||
|
||||
# === STATISTICS ===
|
||||
|
||||
# Interval between dashboard updates (seconds)
|
||||
statistics.update.interval=10.0
|
||||
|
||||
# === EXPECTED BEHAVIOR - LOW LOAD ===
|
||||
# - Average system time: 40-80 seconds
|
||||
# - Maximum queue sizes: 1-3 vehicles
|
||||
# - Average queue sizes: < 1 vehicle
|
||||
# - Vehicles should flow smoothly through the system
|
||||
# - Minimal waiting at traffic lights (mostly travel time)
|
||||
# - System utilization: ~20-30%
|
||||
# - All vehicles should exit within simulation time
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
# =========================================================
|
||||
# Traffic Simulation Configuration - MEDIUM LOAD SCENARIO
|
||||
# ---------------------------------------------------------
|
||||
# Medium traffic scenario for testing system under normal load.
|
||||
# Expected: Moderate queues, some congestion at peak intersections
|
||||
# =========================================================
|
||||
|
||||
# === NETWORK CONFIGURATION ===
|
||||
|
||||
# Intersections (each with its host and port)
|
||||
# Configuração de rede
|
||||
intersection.Cr1.host=localhost
|
||||
intersection.Cr1.port=8001
|
||||
intersection.Cr2.host=localhost
|
||||
@@ -19,65 +10,48 @@ intersection.Cr4.port=8004
|
||||
intersection.Cr5.host=localhost
|
||||
intersection.Cr5.port=8005
|
||||
|
||||
# Exit node
|
||||
exit.host=localhost
|
||||
exit.port=9001
|
||||
|
||||
# Dashboard server
|
||||
dashboard.host=localhost
|
||||
dashboard.port=9000
|
||||
|
||||
|
||||
# === SIMULATION CONFIGURATION ===
|
||||
|
||||
# Total duration in seconds (1800 = 30 minutes)
|
||||
# Configuração da simulação
|
||||
# Cenário de carga média - tráfego normal com algum congestionamento
|
||||
simulation.duration=1800
|
||||
|
||||
# Vehicle arrival model: FIXED or POISSON
|
||||
simulation.arrival.model=POISSON
|
||||
|
||||
# λ (lambda): MEDIUM LOAD = 0.5 vehicles per second (30 vehicles/minute, 1800 vehicles/hour)
|
||||
# This represents normal traffic conditions
|
||||
simulation.arrival.rate=0.5
|
||||
|
||||
# Fixed interval between arrivals (only used if model=FIXED)
|
||||
simulation.arrival.fixed.interval=2.0
|
||||
|
||||
# Routing policy: RANDOM, SHORTEST_PATH, LEAST_CONGESTED
|
||||
simulation.routing.policy=LEAST_CONGESTED
|
||||
|
||||
# Tempos dos semáforos (tempos realistas do mundo real, sem fase amarela)
|
||||
# Cruzamento 1 - ponto de entrada, equilibrado
|
||||
trafficlight.Cr1.South.green=35.0
|
||||
trafficlight.Cr1.South.red=35.0
|
||||
trafficlight.Cr1.East.green=35.0
|
||||
trafficlight.Cr1.East.red=35.0
|
||||
|
||||
# === TRAFFIC LIGHT TIMINGS ===
|
||||
# Format: trafficlight.<intersection>.<direction>.<state>=<seconds>
|
||||
# Optimized timings for medium load
|
||||
# Cruzamento 2 - hub principal, gargalo crítico
|
||||
trafficlight.Cr2.South.green=40.0
|
||||
trafficlight.Cr2.South.red=40.0
|
||||
trafficlight.Cr2.East.green=45.0
|
||||
trafficlight.Cr2.East.red=35.0
|
||||
trafficlight.Cr2.West.green=40.0
|
||||
trafficlight.Cr2.West.red=40.0
|
||||
|
||||
# Intersection 1 (Entry point - balanced)
|
||||
trafficlight.Cr1.South.green=40.0
|
||||
trafficlight.Cr1.South.red=5.0
|
||||
trafficlight.Cr1.East.green=40.0
|
||||
trafficlight.Cr1.East.red=5.0
|
||||
# Cruzamento 3 - caminho para a saída
|
||||
trafficlight.Cr3.South.green=35.0
|
||||
trafficlight.Cr3.South.red=40.0
|
||||
trafficlight.Cr3.West.green=40.0
|
||||
trafficlight.Cr3.West.red=35.0
|
||||
|
||||
# Intersection 2 (Main hub - CRITICAL BOTTLENECK, longer green times)
|
||||
trafficlight.Cr2.South.green=45.0
|
||||
trafficlight.Cr2.South.red=5.0
|
||||
trafficlight.Cr2.East.green=50.0
|
||||
trafficlight.Cr2.East.red=5.0
|
||||
trafficlight.Cr2.West.green=45.0
|
||||
trafficlight.Cr2.West.red=5.0
|
||||
# Cruzamento 4
|
||||
trafficlight.Cr4.East.green=35.0
|
||||
trafficlight.Cr4.East.red=35.0
|
||||
trafficlight.Cr4.North.green=35.0
|
||||
trafficlight.Cr4.North.red=35.0
|
||||
|
||||
# Intersection 3 (Path to exit - favor East toward exit)
|
||||
trafficlight.Cr3.South.green=40.0
|
||||
trafficlight.Cr3.South.red=5.0
|
||||
trafficlight.Cr3.West.green=35.0
|
||||
trafficlight.Cr3.West.red=5.0
|
||||
|
||||
# Intersection 4 (Favor East toward Cr5)
|
||||
trafficlight.Cr4.East.green=40.0
|
||||
trafficlight.Cr4.East.red=5.0
|
||||
trafficlight.Cr4.North.green=40.0
|
||||
trafficlight.Cr4.North.red=5.0
|
||||
|
||||
# Intersection 5 (Near exit - POTENTIAL BOTTLENECK, longer green)
|
||||
# Cruzamento 5 - perto da saída, possível gargalo
|
||||
trafficlight.Cr5.East.green=50.0
|
||||
trafficlight.Cr5.East.red=5.0
|
||||
trafficlight.Cr5.West.green=45.0
|
||||
@@ -85,37 +59,17 @@ trafficlight.Cr5.West.red=5.0
|
||||
trafficlight.Cr5.North.green=45.0
|
||||
trafficlight.Cr5.North.red=5.0
|
||||
|
||||
|
||||
# === VEHICLE CONFIGURATION ===
|
||||
# Probability distribution for vehicle types (must sum to 1.0)
|
||||
# Configuração de veículos
|
||||
vehicle.probability.bike=0.2
|
||||
vehicle.probability.light=0.6
|
||||
vehicle.probability.heavy=0.2
|
||||
|
||||
# Average crossing times (in seconds)
|
||||
vehicle.crossing.time.bike=1.0
|
||||
vehicle.crossing.time.light=2.0
|
||||
vehicle.crossing.time.heavy=4.0
|
||||
|
||||
# Travel times between intersections (in seconds)
|
||||
# Base time for light vehicles (cars)
|
||||
vehicle.travel.time.base=1.0
|
||||
# Bike travel time = 0.5 x car travel time
|
||||
vehicle.travel.time.bike.multiplier=0.5
|
||||
# Heavy vehicle travel time = 4.0 x base travel time
|
||||
vehicle.travel.time.heavy.multiplier=4.0
|
||||
|
||||
# === STATISTICS ===
|
||||
|
||||
# Interval between dashboard updates (seconds)
|
||||
statistics.update.interval=10.0
|
||||
|
||||
# === EXPECTED BEHAVIOR - MEDIUM LOAD ===
|
||||
# - Average system time: 80-150 seconds
|
||||
# - Maximum queue sizes: 5-10 vehicles at Cr2 and Cr5
|
||||
# - Average queue sizes: 2-5 vehicles
|
||||
# - Moderate congestion at Cr2 (main hub) and Cr5 (pre-exit)
|
||||
# - System utilization: ~50-60%
|
||||
# - Most vehicles should exit, some may remain at simulation end
|
||||
# - Cr2 is the primary bottleneck (3 directions converge)
|
||||
# - Cr5 is secondary bottleneck (all routes pass through)
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
# =========================================================
|
||||
# Traffic Simulation Configuration
|
||||
# ---------------------------------------------------------
|
||||
# All parameters controlling network layout, timing,
|
||||
# and simulation behavior.
|
||||
# =========================================================
|
||||
|
||||
# === NETWORK CONFIGURATION ===
|
||||
|
||||
# Intersections (each with its host and port)
|
||||
# Configuração de rede
|
||||
intersection.Cr1.host=localhost
|
||||
intersection.Cr1.port=8001
|
||||
intersection.Cr2.host=localhost
|
||||
@@ -19,92 +10,60 @@ intersection.Cr4.port=8004
|
||||
intersection.Cr5.host=localhost
|
||||
intersection.Cr5.port=8005
|
||||
|
||||
# Exit node
|
||||
exit.host=localhost
|
||||
exit.port=9001
|
||||
|
||||
# Dashboard server
|
||||
dashboard.host=localhost
|
||||
dashboard.port=9000
|
||||
|
||||
|
||||
# === SIMULATION CONFIGURATION ===
|
||||
|
||||
# Total duration in seconds (3600 = 1 hour)
|
||||
# Configuração da simulação
|
||||
simulation.duration=300
|
||||
|
||||
# Time scaling factor for visualization (real_seconds = sim_seconds * scale)
|
||||
# 0 = instant (pure DES), 0.01 = 100x speed, 0.1 = 10x speed, 1.0 = real-time
|
||||
simulation.time.scale=0.01
|
||||
|
||||
# Vehicle arrival model: FIXED or POISSON
|
||||
simulation.arrival.model=POISSON
|
||||
|
||||
# λ (lambda): average arrival rate (vehicles per second)
|
||||
simulation.arrival.rate=0.5
|
||||
|
||||
# Fixed interval between arrivals (only used if model=FIXED)
|
||||
simulation.arrival.fixed.interval=2.0
|
||||
|
||||
# Routing policy: RANDOM, SHORTEST_PATH, LEAST_CONGESTED
|
||||
# RANDOM: selects routes with predefined probabilities (baseline)
|
||||
# SHORTEST_PATH: always chooses the route with fewest intersections
|
||||
# LEAST_CONGESTED: dynamically chooses routes to avoid congested areas
|
||||
simulation.routing.policy=RANDOM
|
||||
|
||||
# Tempos dos semáforos (tempos realistas do mundo real, sem fase amarela)
|
||||
# Cruzamento 1 - ponto de entrada, equilibrado
|
||||
trafficlight.Cr1.South.green=35.0
|
||||
trafficlight.Cr1.South.red=35.0
|
||||
trafficlight.Cr1.East.green=35.0
|
||||
trafficlight.Cr1.East.red=35.0
|
||||
|
||||
# === TRAFFIC LIGHT TIMINGS ===
|
||||
# Format: trafficlight.<intersection>.<direction>.<state>=<seconds>
|
||||
# Cruzamento 2 - hub principal
|
||||
trafficlight.Cr2.South.green=40.0
|
||||
trafficlight.Cr2.South.red=40.0
|
||||
trafficlight.Cr2.East.green=40.0
|
||||
trafficlight.Cr2.East.red=40.0
|
||||
trafficlight.Cr2.West.green=40.0
|
||||
trafficlight.Cr2.West.red=40.0
|
||||
|
||||
# Intersection 1 (Entry point - balanced)
|
||||
trafficlight.Cr1.South.green=60.0
|
||||
trafficlight.Cr1.South.red=5.0
|
||||
trafficlight.Cr1.East.green=60.0
|
||||
trafficlight.Cr1.East.red=5.0
|
||||
# Cruzamento 3 - caminho para a saída
|
||||
trafficlight.Cr3.South.green=35.0
|
||||
trafficlight.Cr3.South.red=40.0
|
||||
trafficlight.Cr3.West.green=40.0
|
||||
trafficlight.Cr3.West.red=35.0
|
||||
|
||||
# Intersection 2 (Main hub - shorter cycles, favor East-West)
|
||||
trafficlight.Cr2.South.green=60.0
|
||||
trafficlight.Cr2.South.red=5.0
|
||||
trafficlight.Cr2.East.green=60.0
|
||||
trafficlight.Cr2.East.red=5.0
|
||||
trafficlight.Cr2.West.green=60.0
|
||||
trafficlight.Cr2.West.red=5.0
|
||||
# Cruzamento 4
|
||||
trafficlight.Cr4.East.green=35.0
|
||||
trafficlight.Cr4.East.red=35.0
|
||||
|
||||
# Intersection 3 (Path to exit - favor East)
|
||||
trafficlight.Cr3.South.green=60.0
|
||||
trafficlight.Cr3.South.red=5.0
|
||||
trafficlight.Cr3.West.green=60.0
|
||||
trafficlight.Cr3.West.red=5.0
|
||||
# Cruzamento 5 - perto da saída
|
||||
trafficlight.Cr5.East.green=35.0
|
||||
trafficlight.Cr5.East.red=35.0
|
||||
|
||||
# Intersection 4 (Favor East toward Cr5)
|
||||
trafficlight.Cr4.East.green=60.0
|
||||
trafficlight.Cr4.East.red=5.0
|
||||
|
||||
# Intersection 5 (Near exit - favor East)
|
||||
trafficlight.Cr5.East.green=60.0
|
||||
trafficlight.Cr5.East.red=5.0
|
||||
|
||||
|
||||
# === VEHICLE CONFIGURATION ===
|
||||
# Probability distribution for vehicle types (must sum to 1.0)
|
||||
# Configuração de veículos
|
||||
vehicle.probability.bike=0.2
|
||||
vehicle.probability.light=0.6
|
||||
vehicle.probability.heavy=0.2
|
||||
|
||||
# Average crossing times (in seconds)
|
||||
vehicle.crossing.time.bike=1.0
|
||||
vehicle.crossing.time.light=2.0
|
||||
vehicle.crossing.time.heavy=4.0
|
||||
|
||||
# Travel times between intersections (in seconds)
|
||||
# Base time for light vehicles (cars)
|
||||
vehicle.travel.time.base=1.0
|
||||
# Bike travel time = 0.5 x car travel time
|
||||
vehicle.travel.time.bike.multiplier=0.5
|
||||
# Heavy vehicle travel time = 4.0 x base travel time
|
||||
vehicle.travel.time.heavy.multiplier=4.0
|
||||
|
||||
# === STATISTICS ===
|
||||
|
||||
# Interval between dashboard updates (seconds)
|
||||
statistics.update.interval=0.1
|
||||
|
||||
1055
main/testing.txt
186
report.tex
Normal file
@@ -0,0 +1,186 @@
|
||||
\documentclass[a4paper,11pt]{article}
|
||||
|
||||
% codificação
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
|
||||
% layout
|
||||
\usepackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry}
|
||||
\usepackage{parskip} % Espaçamento entre parágrafos sem indentação
|
||||
\usepackage{titlesec} % Personalização de títulos
|
||||
|
||||
% cor/estilo
|
||||
\usepackage{xcolor}
|
||||
\definecolor{navyblue}{RGB}{0, 40, 85}
|
||||
\definecolor{codegray}{rgb}{0.95,0.95,0.95}
|
||||
\definecolor{accent}{RGB}{0, 100, 180}
|
||||
|
||||
\usepackage{hyperref}
|
||||
|
||||
\hypersetup{
|
||||
pdftitle={Relatório de Correção de Regressão de Desempenho em Linux},
|
||||
pdfauthor={Leandro Afonso},
|
||||
pdfsubject={Análise Técnica},
|
||||
pdfkeywords={Linux, Java, Latency, Syscall, Optimization},
|
||||
pdfcreator={pdfLaTeX}
|
||||
}
|
||||
|
||||
% data
|
||||
\renewcommand{\today}{%
|
||||
\number\day\ de %
|
||||
\ifcase\month\or
|
||||
Janeiro\or Fevereiro\or Março\or Abril\or Maio\or Junho\or
|
||||
Julho\or Agosto\or Setembro\or Outubro\or Novembro\or Dezembro%
|
||||
\fi
|
||||
\ de \number\year%
|
||||
}
|
||||
|
||||
% tabelas
|
||||
\usepackage{booktabs}
|
||||
\usepackage{array}
|
||||
|
||||
% conf
|
||||
\usepackage{listings}
|
||||
\lstset{
|
||||
backgroundcolor=\color{codegray},
|
||||
basicstyle=\ttfamily\small,
|
||||
breakatwhitespace=false,
|
||||
breaklines=true,
|
||||
captionpos=b,
|
||||
commentstyle=\color{green!50!black},
|
||||
keywordstyle=\color{blue},
|
||||
stringstyle=\color{red},
|
||||
frame=single,
|
||||
rulecolor=\color{black!20},
|
||||
numbers=left,
|
||||
numberstyle=\tiny\color{gray},
|
||||
stepnumber=1,
|
||||
tabsize=4,
|
||||
showstringspaces=false
|
||||
extendedchars=true,
|
||||
literate={á}{{\'a}}1 {ã}{{\~a}}1 {é}{{\'e}}1 {ç}{{\c{c}}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {õ}{{\~o}}1 {ú}{{\'u}}1 {µ}{{\ensuremath{\mu}}}1 {€}{{\euro}}1,
|
||||
}
|
||||
|
||||
% seccões
|
||||
\titleformat{\section}
|
||||
{\color{navyblue}\normalfont\Large\bfseries}
|
||||
{\thesection}{1em}{}
|
||||
|
||||
\titleformat{\subsection}
|
||||
{\color{navyblue}\normalfont\large\bfseries}
|
||||
{\thesubsection}{1em}{}
|
||||
|
||||
% metadados
|
||||
\title{\textbf{\color{navyblue}Relatório de Correção de Regressão de Desempenho em Linux}}
|
||||
\author{Leandro Afonso}
|
||||
\date{\today}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\section{Resumo do Problema}
|
||||
A simulação distribuída de tráfego demonstrou uma regressão significativa de desempenho em ambiente Linux nativo quando comparada com a execução em Windows/Wine.
|
||||
|
||||
A tabela abaixo ilustra a discrepância nas taxas de conclusão de veículos dentro da janela de simulação fixa:
|
||||
|
||||
\begin{table}[h]
|
||||
\centering
|
||||
\begin{tabular}{@{}lc@{}}
|
||||
\toprule
|
||||
\textbf{Ambiente} & \textbf{Taxa de Conclusão} \\
|
||||
\midrule
|
||||
Windows / Wine & $\sim 95-100\%$ \\
|
||||
Linux (OpenJDK Nativo) & $\sim 44\%$ \\
|
||||
Linux (com \texttt{strace}) & $\sim 91\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Comparação de desempenho por ambiente.}
|
||||
\end{table}
|
||||
|
||||
O \textit{insight} crucial surgiu ao descobrir que a execução sob \texttt{strace} recuperava a taxa de conclusão para 91\%. O \texttt{strace} introduz \textit{overhead} em cada \textit{syscall}, o que, paradoxalmente, estabilizou o sistema ao forçar um abrandamento natural (\textit{throttling}).
|
||||
|
||||
\section{Causa Raiz}
|
||||
\textbf{O Linux executa demasiado rápido.}
|
||||
|
||||
O Coordenador gera veículos a uma velocidade superior à capacidade de processamento das interseções distribuídas e da pilha de rede. Em Windows/Wine, o \textit{overhead} inerente à emulação e ao agendador do SO limita naturalmente a taxa de transferência do sistema.
|
||||
|
||||
Em Linux nativo, a execução mais célere provoca uma condição de corrida sistémica:
|
||||
\begin{itemize}
|
||||
\item A geração de veículos excede a capacidade de processamento imediato dos nós.
|
||||
\item As filas de eventos congestionam (\textit{back up}) rapidamente nas interseções.
|
||||
\item Veículos gerados tardiamente não dispõem de tempo de CPU suficiente para concluir o percurso antes do fim da simulação.
|
||||
\end{itemize}
|
||||
|
||||
\section{Solução Implementada}
|
||||
A correção consistiu na introdução de micro-atrasos (\textit{micro-throttles}) utilizando \texttt{LockSupport.parkNanos()}. Esta abordagem simula o \textit{overhead} natural presente no ambiente Windows, permitindo o escoamento das filas de E/S.
|
||||
|
||||
\subsection{Alterações no Código}
|
||||
|
||||
\textbf{1. Ficheiro: \texttt{SocketConnection.java}} \\
|
||||
Adicionado um atraso de 50$\mu$s após operações de E/S para permitir o processamento da pilha TCP.
|
||||
|
||||
\begin{lstlisting}[language=Java, title={SocketConnection.java (Excerto)}]
|
||||
// Em sendMessage() após o flush:
|
||||
dataOut.flush();
|
||||
LockSupport.parkNanos(50000); // 50 us delay
|
||||
|
||||
// Em receiveMessage() após readFully:
|
||||
dataIn.readFully(data);
|
||||
LockSupport.parkNanos(50000); // 50 us delay
|
||||
\end{lstlisting}
|
||||
|
||||
\textbf{2. Ficheiro: \texttt{CoordinatorProcess.java}} \\
|
||||
Adicionado um atraso de 100$\mu$s na geração de veículos para limitar a taxa de produção.
|
||||
|
||||
\begin{lstlisting}[language=Java, title={CoordinatorProcess.java (Excerto)}]
|
||||
// Em generateAndSendVehicle():
|
||||
sendVehicleToIntersection(vehicle, entryIntersection);
|
||||
LockSupport.parkNanos(100000); // 100 us delay
|
||||
\end{lstlisting}
|
||||
|
||||
\textbf{Nota: \textnormal{Em ambos os ficheiros deve ser importado java.util.concurrent.locks.LockSupport.}}
|
||||
|
||||
\section{Resultados e Validação}
|
||||
|
||||
A aplicação dos atrasos sintéticos restaurou a paridade de desempenho entre os sistemas operativos.
|
||||
|
||||
\begin{table}[h]
|
||||
\centering
|
||||
\begin{tabular}{@{}lcc@{}}
|
||||
\toprule
|
||||
\textbf{Ambiente} & \textbf{Antes da Correção} & \textbf{Após Correção} \\
|
||||
\midrule
|
||||
Linux Nativo & $\sim 44\%$ & $\mathbf{\sim 92\%}$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
|
||||
\subsection{Por que funciona?}
|
||||
\begin{itemize}
|
||||
\item \textbf{Precisão:} \texttt{LockSupport.parkNanos()} oferece um atraso preciso e não bloqueante, com impacto mínimo no agendador do SO, ao contrário de \texttt{Thread.sleep()}.
|
||||
\item \textbf{Ritmo de E/S (50$\mu$s):} Abranda a comunicação via \textit{socket} o suficiente para evitar a saturação dos \textit{buffers} de receção das interseções.
|
||||
\item \textbf{Controlo de Fluxo (100$\mu$s):} Limita a produção do Coordenador, garantindo que o sistema a jusante consegue processar os eventos em tempo útil.
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Verificação}
|
||||
Para validar a correção no ambiente de desenvolvimento:
|
||||
|
||||
\begin{lstlisting}[language=bash]
|
||||
mvn clean compile
|
||||
mvn javafx:run
|
||||
\end{lstlisting}
|
||||
|
||||
\textbf{Resultado Esperado:} Taxa de conclusão superior a 90\%.
|
||||
|
||||
\section{Abordagens Alternativas (Falhadas)}
|
||||
As seguintes tentativas foram realizadas antes da solução final, sem sucesso:
|
||||
\begin{itemize}
|
||||
\item \textbf{Thread.sleep(1):} Demasiado impreciso (granularidade mínima de $\sim$1ms em Linux), causando atrasos excessivos.
|
||||
\item \textbf{Thread.yield():} Sem efeito prático no agendador CFS do Linux neste contexto.
|
||||
\item \textbf{Garbage Collectors:} A alteração entre G1, Parallel e Shenandoah não surtiu efeito.
|
||||
\item \textbf{Versão Java:} Testes com Java 17 e 25 mostraram o mesmo comportamento.
|
||||
\item \textbf{Prioridade de Threads:} Ajustes de prioridade na JVM foram ignorados pelo SO.
|
||||
\end{itemize}
|
||||
|
||||
\end{document}
|
||||