Skip to content

Commit a16dbee

Browse files
committed
documentazione quasi finita
rimane da scrivere la parte sul test del PlannerBCR poi è finita
1 parent 3e1cba5 commit a16dbee

File tree

3 files changed

+172
-29
lines changed

3 files changed

+172
-29
lines changed

Sprint1/resources/userDocs/conclusions.html

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
<a href="#Sprint-Review">Sprint Review</a>
3232
<a href="#Sprint-Retrospective">Sprint Retrospective</a>
3333
<a href="#Work-Plan">Work Plan</a>
34-
<!--<div class="sidenavSection">
34+
<div class="sidenavSection">
3535
<a href="#Sprint2">Sprint2</a>
3636
<a href="#Sprint3">Sprint3</a>
37-
</div>-->
37+
</div>
3838
</div>
3939
<a href="team.html">Team</a>
4040
<p class="separator">&mdash;&mdash;&mdash;&ndash;&ndash;&mdash;&mdash;&mdash;</p>
@@ -47,15 +47,20 @@
4747
<h1 align="center">Sprint Conclusions</h1>
4848

4949
<h2 id="Summary">Summary</h2>
50-
Sprint recap
50+
During Sprint 1 our team analyzed and implemented the software related to the Core-business
51+
of the system, trying to meet in the best way possible the customer requirements.
52+
<br/>
53+
We had been able to develop and test different softwares, to ease tasks like the map configuration,
54+
and to improve the system by making it <i>scalable</i> and <i>flexible</i>.
55+
We tested the WasteService by connecting the SmartDevice from different nodes: Android emulator, Android
56+
real device, with LAN and remote connections.
5157
<div class="remark">
58+
The implemented softwares are the following:
5259
<ol class="summary">
53-
<li>
54-
</li>
55-
<li>
56-
</li>
57-
<li>
58-
</li>
60+
<li><ksi>SmartDevice Simulator</ksi></li>
61+
<li>Echo Waste Server</li>
62+
<li>Map Editor BCR</li>
63+
<li><ksi>WasteService</ksi></li>
5964
</ol>
6065
</div>
6166

@@ -228,7 +233,14 @@ <h3 id="Demo">Demo</h3>
228233
<h2 id="Sprint-Review">Sprint Review</h2>
229234

230235
<h2 id="Sprint-Retrospective">Sprint Retrospective</h2>
231-
Upgrade QAK libraries to last version.
236+
<!--
237+
TO-DO:
238+
<ol>
239+
<li>Upgrade QAK libraries to latest version.</li>
240+
<li>Create script to update local docker image.</li>
241+
<li>Deploy WasteService as a JAR.</li>
242+
</ol>
243+
-->
232244

233245
<h2 id="Work-Plan">Work Plan</h2>
234246
The next sprint is <a href="../../../Sprint2/index.html">Sprint2</a>, which involves the requirement <b>4</b>.

Sprint1/resources/userDocs/project.html

Lines changed: 139 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@
2929
<a href="#Waste-Service">Waste Service</a>
3030
<div class="sidenavSubSection">
3131
<a href="#Waste-Service-Logical-Architecture">Waste Service<br/>Logical Architecture</a>
32+
<a href="#wasteservice-WasteService">WasteService</a>
33+
<a href="#wasteservice-Utils">Utils</a>
3234
<a href="#Planner-BCR">PlannerBCR</a>
33-
<a href="#Waste-Service-Actors">Actors</a>
35+
<a href="#Waste-Service-QAK-Actors">QAK Actors</a>
36+
<a href="#WEnv">Virtual Environment<br/>(WEnv)</a>
3437
</div>
38+
<a href="#Deployment">Deployment</a>
39+
<a href="#WasteService-Demo">WasteService Demo</a>
3540
</div>
3641
<a href="test_plans.html">Test Plans</a>
3742
<a href="conclusions.html">Conclusions</a>
@@ -115,7 +120,7 @@ <h4>Class Diagram</h4>
115120

116121
<h2 id="Echo-Waste-Server">Sprint 1.1: Echo Waste Server</h2>
117122
<ksi>Echo Waste Server</ksi> (<a href="../../Sprint1_Project/sprint1_echo_waste_server/">sprint1_echo_waste_server</a>)
118-
is a mobile/desktop application that simulates a dummy WasteService and acts like an echo server:
123+
is a mobile/desktop application that simulates a dummy WasteService and acts like an "enhanced" echo server:
119124
it accepts TCP connections and reply to <code>store_requests</code> with <code>load_accepted</code> / <code>load_rejected</code>,
120125
updating the capacity of containers and logging messages.
121126
<br/><br/>
@@ -181,20 +186,45 @@ <h4>Class Diagrams</h4>
181186

182187
<h2 id="Waste-Service">Sprint 1.3: Waste Service</h2>
183188
<ksi>Waste Service</ksi> (<a href="../../Sprint1_Project/sprint1_waste_service/">sprint1_waste_service</a>)
184-
185-
186-
To simulate the behaviour of the DDR robot, we can use the Virtual Environment (WEnv) provided by our software house,
187-
188-
189-
spiegare basic robot (docker images), pathexecutor, planner
190-
<highlight2>QAK model: spiegare gli attori</highlight2>
189+
is the heart of the project. It's the main element of the core-business but also the main element of the whole
190+
distributed system: it receives requests from smart devices and handles the interactions with other components,
191+
such as (in the current Sprint) the TransportTrolley.
191192

192193
<h3 id="Waste-Service-Logical-Architecture">Waste Service Logical Architecture</h3>
193194
<img width="100%" src="../../Sprint1_Project/sprint1_waste_service/project_logical_architecture_waste_service.png"/>
194195
QAK model: <a href="../../Sprint1_Project/sprint1_waste_service/src/waste_service.qak">waste_service.qak</a>
195196

197+
<h3 id="wasteservice-WasteService">WasteService</h3>
198+
<ksi>wasteservice.WasteService</ksi> is a Kotlin class used to store information about the service:
199+
it contains 3 maps of type <code>EnumMap&lt;WasteType, Double&gt;</code> that represent an amount of KG
200+
for each WasteType of the service:
201+
<ul>
202+
<li>
203+
<ks><code>preStorage</code></ks> - is updated as soon as the TransportTrolley starts processing a deposit request.
204+
This way we can instantly reply with a negative answer (loadRejected) if a certain amount of waste cannot be stored
205+
</li>
206+
<li>
207+
<ks><code>storage</code></ks> - is updated when the deposit is completed (it represents
208+
the actual current state of the containers).
209+
</li>
210+
<li>
211+
<ks><code>storageCapacity</code></ks> - is the max amount of waste that each container can store.
212+
</li>
213+
</ul>
214+
Aswell as the maps, the class contains methods to get and update the values of the containers, which are used
215+
by the QAK actor of the WasteService.
216+
217+
<h3 id="wasteservice-Utils">Utils</h3>
218+
<ksi>wasteservice.Utils</ksi> is a Kotlin object that contains utility methods, for example to parse and validate the waste types,
219+
or to simulate an action:
220+
<ul>
221+
<li><ks><code>simulateAction(Double)</code></ks> takes an amount of waste and simulate an action,
222+
for example the pickup or deposit, by waiting for an amount of time which is proportional to it.
223+
</li>
224+
</ul>
225+
196226
<h3 id="Planner-BCR">PlannerBCR</h3>
197-
PlannerBCR is an <i>extension</i> of the Planner22Util Kotlin object, provided by our software house.
227+
<ksi>PlannerBCR</ksi> is an <i>extension</i> of the Planner22Util Kotlin object, provided by our software house.
198228
We added the <b>support for the map configuration</b>, by exposing some new static methods:
199229
<ul>
200230
<li>
@@ -233,7 +263,7 @@ <h3 id="Planner-BCR">PlannerBCR</h3>
233263
implementation files('../unibolibs/map_editor_bcr.jar')
234264
</pre>
235265

236-
<h3 id="Waste-Service-Actors">Actors</h3>
266+
<h3 id="Waste-Service-QAK-Actors">QAK Actors</h3>
237267
<table class="dictionary">
238268
<tr>
239269
<th>Actor</th>
@@ -263,7 +293,8 @@ <h3 id="Waste-Service-Actors">Actors</h3>
263293
<td>Ctx_TransportTrolley</td>
264294
<td>
265295
Receive the deposit requests from the WasteService and performs them:
266-
296+
to <b>simulate</b> the actual pickup and dump of the waste, we delay the execution
297+
of an amount which is <b>proportional to the load weight</b>.
267298
</td>
268299
</tr>
269300
<tr>
@@ -285,11 +316,105 @@ <h3 id="Waste-Service-Actors">Actors</h3>
285316
</tr>
286317
</table>
287318

319+
<h3 id="WEnv">Virtual Environment (WEnv)</h3>
320+
Our software house provided the software to virtually simulate the robot inside the room, in the form
321+
of a <a href="../../../unibo.basicrobot22/virtualRobotOnly4.0.yaml">docker image</a>.
322+
<br/>
323+
To run it simply enter the following command, after moving to its directory (<a href="https://www.docker.com/">docker</a> needed):
324+
<pre>
325+
docker-compose -f .\virtualRobotOnly4.0.yaml up
326+
</pre>
327+
NB: we use the image with only the virtual robot, because our basic robot (which is needed for the simulation to work,
328+
is a QAK actor).
329+
<br/><br/>
330+
<a href="../../../commons/docker/dockerNotes.html">BCR Docker Notes</a>
331+
288332
<h2 id="Deployment">Deployment</h2>
289-
Where to download the software.
333+
As a result of the project phase, we produced a series of applications, which
334+
can be downloaded from the repository on GitHub:
335+
<ul>
336+
<li>SmartDevice Simulator: APK.</li>
337+
<li>Echo Waste Server: APK or Desktop versions.</li>
338+
<li>Map Editor BCR: self-containing JAR (requires Java 11).</li>
339+
<li>WasteService: IntelliJ project.</li>
340+
</ul>
341+
In order to being able to run the main of the contexts separately, we created 3 different
342+
gradle tasks:
343+
<pre style="white-space: pre;">
344+
task(runCtx_WasteService, dependsOn: 'classes', type: JavaExec) {
345+
mainClass = 'it.unibo.ctx_wasteservice.MainCtx_wasteserviceKt'
346+
classpath = sourceSets.main.runtimeClasspath
347+
}
348+
349+
task(runCtx_TransportTrolley, dependsOn: 'classes', type: JavaExec) {
350+
mainClass = 'it.unibo.ctx_transporttrolley.MainCtx_transporttrolleyKt'
351+
classpath = sourceSets.main.runtimeClasspath
352+
}
353+
354+
task(runCtx_Robot, dependsOn: 'classes', type: JavaExec) {
355+
mainClass = 'it.unibo.ctx_robot.MainCtx_robotKt'
356+
classpath = sourceSets.main.runtimeClasspath
357+
}
358+
</pre>
359+
Those tasks allow us to run each context using a specific gradle demon, with the following commands:
360+
<ul>
361+
<li>
362+
Run the <ks>Robot</ks> context:
363+
<pre>
364+
./gradlew runCtx_Robot
365+
</pre>
366+
</li>
367+
<li>
368+
Run the <ks>TransportTrolley</ks> context:
369+
<pre>
370+
./gradlew runCtx_TransportTrolley
371+
</pre>
372+
</li>
373+
<li>
374+
Run the <ks>WasteService</ks> context:
375+
<pre>
376+
./gradlew runCtx_WasteService
377+
</pre>
378+
</li>
379+
</ul>
290380

291381
<h2 id="WasteService-Demo">WasteService Demo</h2>
292-
<highlight2>script per avviare la demo, con parametri, spiegare il setup e cosa fa la demo.</highlight2>
382+
In order to run demo components we need:
383+
<ul>
384+
<li>Java 11 or more recent</li>
385+
<li>Gradle 7.4.1 or more recent</li>
386+
<li>Docker</li>
387+
<li>Flutter</li>
388+
</ul>
389+
390+
The directory <a href="../../Sprint1_Project/scripts/">scripts/</a> contains batch scripts to run the sprint1 demo on Windows:
391+
<ol>
392+
<li>
393+
<a href="../../Sprint1_Project/scripts/run_VirtualRobot.bat">run_VirtualRobot.bat</a> - runs the docker image of the WEnv, and opens a new
394+
chrome window to show the robot.
395+
</li>
396+
<li>
397+
<a href="../../Sprint1_Project/scripts/run_AndroidEmulator.bat">run_AndroidEmulator.bat</a> - starts a Google Pixel_3a_API_30_x86 emulator
398+
(Android).
399+
</li>
400+
<li>
401+
<a href="../../Sprint1_Project/scripts/run_WasteService.bat">run_WasteService.bat</a> - starts 3 gradle demons, one for each context of
402+
the WasteService.
403+
</li>
404+
<li>
405+
<a href="../../Sprint1_Project/scripts/run_SmartDevice.bat">run_SmartDevice.bat</a> - runs an integration demo test for the SmartDevice
406+
that succeeds if it was able to connect to the WasteService, receive the types, and receive a reply to the store request.
407+
It can take 4 or 0 arguments (the order matters):
408+
<ol>
409+
<li><code>IP</code> - the IP address of the host the SmartDevice will try to connect (WasteService).</li>
410+
<li><code>Port</code> - the port on which the service of the WasteService runs.</li>
411+
<li><code>WasteType</code> - the type of waste we want to use during the test.</li>
412+
<li><code>WasteWeight</code> - the amount of waste we want to dumo during the test.</li>
413+
</ol>
414+
</li>
415+
</ol>
416+
417+
293418
<h4>Setup Remote Communications</h4>
294419
<div class="remark">
295420
<b>Port Forwarding</b>

Sprint1/resources/userDocs/test_plans.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@
2323
<a href="project.html">Project</a>
2424
<a class="selected" href="test_plans.html">Test Plans</a>
2525
<div class="sidenavSection">
26-
<a href="#Interactions">Interactions</a>
26+
<a href="#Smart-Device">Smart Device</a>
2727
<div class="sidenavSubSection">
28-
<a href="#Smart-Device-Waste-Service">SmartDevice &harr;<br/>WasteService</a>
29-
<a href="#Waste-Service-Transport-Trolley">WasteService &harr;<br/>TransportTrolley</a>
30-
<a href="#Transport-Trolley-DDR-Robot">TransportTrolley &harr;<br/>DDR Robot</a>
28+
<a href="#Unit-Test">Unit Test</a>
29+
<a href="#Widget-Test">Widget Test</a>
30+
<a href="#Integration-Test">Integration Test</a>
31+
</div>
32+
<a href="#Waste-Service">Waste Service</a>
33+
<div class="sidenavSubSection">
34+
<a href="#MapConfig">MapConfig</a>
35+
<a href="#PlannerBCR">PlannerBCR</a>
3136
</div>
3237
</div>
3338
<a href="conclusions.html">Conclusions</a>
@@ -331,7 +336,8 @@ <h3 id="Integration-Test">Integration Test</h3>
331336

332337

333338
<h2 id="Waste-Service">Waste Service</h2>
334-
<h3>PlannerBCR + MapConfig</h3>
339+
<h3 id="MapConfig">MapConfig</h3>
340+
<h3 id="PlannerBCR">PlannerBCR</h3>
335341
<highlight2>to-do</highlight2>
336342
</div>
337343

0 commit comments

Comments
 (0)