Context and Motivation
Our project is part of a greater initiative to promote sustainability and innovation in the
natural
stone industry.
Below is a brief description of the broader project and its goals, aswell as a link to the official page
for
more information.
Sustainable Stone by Portugal, Projeto-WP2
"A digitalização na indústria da pedra natural implica que os principais elementos da cadeia de valor estejam preparados com um conjunto inovador de tecnologias disruptivas e competências técnicas que, num período de 5 a 10 anos, permite a este setor acompanhar a rápida evolução do mercado onde compete: o setor de Materiais de Construção. Para atingir este objetivo, o atual WP foi criteriosamente elaborado para responder aos principais desafios da transição digital associados aos processos de fabrico, estando alinhado com o novo paradigma de valorização sustentável das matérias-primas ao longo de toda a cadeia de valor. Este conjunto de tecnologias visa não só uma valorização da matéria-prima e redução de desperdícios, mas principalmente a utilização de excedentes de fabricação em novos materiais. Ou seja, promover, através da digitalização o desenvolvimento de uma estratégia de economia circular, trazendo uma segunda vida dos produtos desta indústria."
(Translated to English)
Digitalization in the natural stone industry requires that the key elements of the value chain be
equipped with an innovative set of disruptive technologies and technical skills that, over a period of 5
to 10 years, will enable the sector to keep pace with the rapid evolution of the market in which it
competes: the Construction Materials sector. To achieve this goal, the current work package (WP) was
carefully designed to address the main challenges of the digital transition associated with
manufacturing processes, aligned with the new paradigm of sustainably adding value to raw materials
across the entire value chain. This set of technologies aims not only to increase the value of raw
materials and reduce waste, but especially to use manufacturing surpluses in new materials. In other
words, to promote—through digitalization—the development of a circular economy strategy, giving a second
life to this industry’s products.
Project overview
This project develops a complete pipeline for studying, simulating and visualizing industrial production lines. We implement a discrete-event simulation to model operations and build an interactive 3D/2D visualization that replays simulation events. We also plan to investigate reinforcement learning methods to discover control policies that could improve throughput, reduce waste and increase energy efficiency. Note: the AI / reinforcement learning work is a research objective and has not been implemented yet — see "Plans & Objectives" for details.
Key components
- Simulation: Written in Python using simPy to represent machines, buffers and events precisely.
- Visualization: A compact WebGL/Three.js viewer that consumes event traces to render an animated factory model.
- Optimization (planned): Investigation of reinforcement learning approaches to adapt control decisions and improve production metrics — currently a stated research objective (see Plans & Objectives).
Why this matters
Small changes in scheduling or machine coordination can have outsized effects on throughput and energy consumption. By combining precise simulation, interactive visualization and data-driven experiments, the team can rapidly prototype strategies, validate outcomes and present results to industrial stakeholders in an intuitive way.
Team
Work developed by our team. Student members participated under IST scholarships; professors and the PhD student led, coordinated and advised the project.
- José Gaspar — Professor at IST — project coordinator & scientific advisor
- Pedro Miraldo — Researcher at MERL, Cambridge MA — project coordinator & scientific advisor
- Valter Piedade — PhD Student at IST — research support & scientific advisor
- Filipe Baptista — MSc Student at IST — main lead for the simulation component
- João Norte — MSc Student at IST — main lead for the visualization component
Simulation
Simulation components
The simulation is fully written in Python and has three components configurable via yaml files
- Discrete event simulation library - Manages transporters, machines, stocks and entities during simulation
- Path finding - Pre-calculates all paths within the factory
- Random Scheduling - Run simulations with random orders and performing random actions
Discrete event simulation library
The discrete event simulation library is based on SimPy and provides the API to run a simulation and log the result.
A simulation starts by using a config module to load a YAML configuration file with all the information of the factory. This will initalize all the machines, stocks and transporters. Entities can then be moved between places (stocks and machines) by the transporter module. This module takes care of coordinating transporters to simulate the correct time that it would take to move an entity from A to B, choosing which transporters to use and blocking them from being used elsewhere. The transporters will also not be able to place the entities in a stock/machine if it's too full because all stocks and machines have a limited volume to store entities. After an entity is inside a machine it can be operated on, operations include things like resizing a block, cutting a block into slabs etc. All these events can then be logged into a Json readable by the visualizer.
Path finding
The path finding module is responsible for pre-calculating all the paths used in the simulation. A YAML configuration file specifies the positions of all the machines and stocks within the factory, regions that each transporter can reach and the points where transporters can handoff items between one another. Then it calculates for each pair of points inside of a transporters region, how long that transporter takes to travel that distance. For each pair of stocks/machines a path is then calculated which is characterized by: the segments of the path, which transporter is responsible for each segment.
Random Scheduling
The random scheduling module is used to create random simulation using random orders. A configuration file specifies the frequency of the random orders and the distribution of the order items. Each order requires a specified quantity of an entity that must have specific operations performed on it and a specified size. Then a simulation can be run where entities are sent to randomly inside the factory in ways that work toward the fulfillment of the incoming orders, this allows for the generation of training data. The decision process used in this random scheduling is shown below
Visualization
Server & configuration
The visualization is served by a small Express.js backend. The server stores editable configuration files that define the layout of machines, stocks, walls, etc. These configuration files can be edited from the frontend and reloaded by the viewer so users can quickly test different factory layouts without changing code.
The 3D mode provides a realistic, camera-controlled view of the factory using Three.js. It reads an "online" log through a mock API that currently serves offline traces; the same API can be adapted to stream live events. An event scheduler ensures that events are shown in the correct order and at the correct time, preserving causality and temporal relationships between entities and machines.
2D mode — fast trace replay
The 2D mode is designed for speed and clarity. It consumes an offline recorded simulation log and draws the trajectories of entities (blocks and slabs) on a simple 2D floor plan. This mode is ideal for quick inspection, debugging and generating annotated videos or screenshots.
3D mode — interactive, timed replay
In 3D mode the user can freely navigate the scene, follow specific entities or machines, and control playback speed to slow down on critical moments or accelerate long idle periods. The visual result is generally slower-paced than the 2D, which gives viewers a stronger sense of space and time.
Multi-device & responsive UI
The viewer UI is responsive and adapts to desktop, tablet and mobile screens. Graphics quality, such as textures ON or OFF, and controls can be adjusted depending on device capabilities to keep performance acceptable on lower-power devices.
Technologies
Primary tools used in the project:
- Node.js + Express for the lightweight server
- Python + simPy for discrete-event simulation and mock API
- Three.js / WebGL for browser-based 3D visualization
- Standard web stack (HTML/CSS, JS) for the browser-based 2D visualization
Plans & Objectives
- Setup of a system for collecting data on industrial processes;
- Implementation of a simulator that can create road maps based on the jobs described on the factory's VSM diagram;
- Implementation of the platform for the graphical interface linked to the simulation system;
- Adapt the simulator to be flexible to incorporate new VSM-derived functionalities if needed;
- Definition of the optimization process;
- Train a decision-making (optimization) agent using the various road maps collected from the factory's logs and/or generated through the simulator;
- Test and validate the agent by comparing its generated routing with the factory technician’s decision (“calibration” of the simulator);