Git Product home page Git Product logo

iss2022-bcr / wasteservice Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 306.21 MB

Distributed software system for a differentiated waste disposal service. The project had been developed for the course of Software Systems Engineering M @Unibo

Home Page: https://htmlpreview.github.io/?https://raw.githubusercontent.com/iss2022-BCR/WasteService/main/Sprint0/index.html

License: MIT License

CSS 3.53% HTML 27.70% JavaScript 1.23% Python 4.26% Prolog 3.45% Kotlin 32.16% Jupyter Notebook 3.96% Shell 3.50% C 2.57% Java 7.11% Swift 0.09% Objective-C 0.01% Dart 5.66% CMake 1.31% C++ 1.48% Dockerfile 0.09% Batchfile 1.85% NSIS 0.05%
design-patterns design-principles distributed-systems flutter java raspberry-pi software-engineering kotlin ingegneria sistemi

wasteservice's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wasteservice's Issues

State HOME for a step right before PICKUP/DUMP

If an alarm occurs when the TransportTrolley performed the last step of a path, right before starting the PICKUP or DUMP actions, its state becomes HOME for a moment.

Example

As we notice, at min 0:12, when the TransportTrolley task gets resumed, its state becomes HOME for a moment, instad of becoming DUMP immediately.

2023-04-18_00-35-21.online-video-cutter.com.mp4

SmartDevice [Windows]: Broken StoreRequest Reply

Problem

The Windows version of the SmartDevice doesn't receive the store_request reply properly: it gets somehow fragmented, therefore the creation of the ApplMessage throws an exception.

Temporary Patch

  • log the message as soon as it's received;
  • catch the exceptions thrown by ApplMessage parsing and log the error message.

Possible Fix

  • use a buffer to store the received messages bits, and create the ApplMessage when all the parameters have been received.

Actor TrolleyStateProvider keeps updating

The actor TrolleyStateProvider keeps updating the COAP resource with "MOVING" and "HOME" states, even though the state doesn't change.

That could be due to the fact that we use 2 different actors to update the COAP resource.

DisplayLCD: Text gets blurry/buggy from time to time

Sometime the display LCD text

Possible Reasons

That could be due to:

  • power supply degradated, since we're getting a warning on the Raspberry Pi
    image
  • power sharing between components (each component we used shares the same PIN #โ€‹2/40 for the 5V power, and the same PIN #โ€‹6/40 for the ground);
  • cables may not be connected properly;

WasteService Core: PICKUP/DUMP trolley state

The PICKUP and DUMP trolley states seem to be arriving too late (right before the following state), therefore the led doesn't stay turned ON for long.

Example

Pickup action lasting 5 seconds. The Pickup state is the following:

State state_pickup {
	updateResource [# "transporttrolley(PICKUP)" #]
		
	println("[TransportTrolley] Picking up the load of $WasteType...")
	[# wasteservice.Utils.simulateAction(WasteLoad) #]
	println("[TransportTrolley] Pickup completed.")
		
	replyTo deposit with pickupcompleted: pickupcompleted(_) caller== wasteservice
}
Goto state_move_to_box

As we notice, the updateResource call is placed before the print, but at min 0:05 we can see that:
while on the Tranport Trolley (upper-left terminal) has already printed [TransportTrolley] Picking up the load of GLASS..., the Raspberry (lower-right terminal) doesn't receive the update until after the simulation of the action has terminated [# wasteservice.Utils.simulateAction(WasteLoad) #].
That shouldn't happen, since the interaction between the TransportTrolley and the TrolleyStateProvider is asynchronous and monodirectional, through COAP updates.

pickup_dump_issue.mp4

Consequence

As a consequence we never see the led being ON during pickups and dumps: those 2 actions appears to be lasting too little from the Raspberry perspective.

WasteService Core: HOME/MOVING trolley state

After completing at least one deposit, when the Transport Trolley returns at home, if a stop event is detected and the Transport Trolley enters the STOPPED state, when resuming the PathExecutor mistakenly propagates the state MOVING, instead of HOME.

Example

At min 0:21 we can notice that while the Transport Trolley is at HOME, after a stop and resume events are detected, instead of returning to the HOME state, it enters the MOVING state.

issue_home_moving.mp4

Events doesn't get delivered in a distributed environment

While if each context runs one the same machine, the stop/resume events correctly get delivered to each context and are observed by the PathExecutorBCR, when moving the raspberry context to a distributed context they seem to disappear.

WasteService Core: LoadRejected is not sent immediately if the trolley is already performing a deposit

Problem

Since the WasteService ask the TransportTrolley for a deposit action through a request/response interaction, if the trolley is performing a deposit action, and the WasteService receives a new (invalid) store request, it cannot reply until the previous deposit action is completed.

Possible Fix

  • Change the WasteService - TransportTrolley interaction from a request/response to a fire a pair of dispatch (eventually adding a boolean variable to indicate when the trolley is busy).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.