Skip to content

Conversation

@jpsiegel
Copy link

@jpsiegel jpsiegel commented Jul 4, 2025

Elevators - Jan Siegel

Overview

This software system is used to create high quality synthetic data and store it to be used in a ML ingestion pipeline.
The design considers 3 main components:

  • Simulation
  • API
  • Database

Simulation

A descrete event simulation in simpy is proposed to model the elevator scenario, its a great tool for logistics and phenomena that follows Poisson processes.
This allows us to recreate an environment where the elevator can perform its actions realistically and add all the logic we want.
For this case a simple simulation was created, considering a single elevator in a building with n floors, the requests are taken and executed in FIFO order.
A bit of business logic was added, considering that the first floor is usually at street level and is much busier, a spike in the demand for floor one was added, also, the elevator rests at the first floor when idle.
The generated data is posted to the API at runtime.

API

A simple FastAPI was developed, with endpoint to create and read generated data. See routes.py
These allow the simulation to store data in the database, and the future ML pipeline to retrieve this data to train.
Also, tests were added to check the endpoints functionality.

Database

A FastAPI data model connected to a PostgreSQL data schema is proposed (see models.py) to store simulation metadata and labeled demand data.
We store a snapshot of the state of the simulation when a relevant demand was created (features) and then add the next requested floor created after that scenario (label).
Also, a simple test was added to check the database connection with the API.

Note

The system was designed in a containerized fashion, to be able to deploy it easily in a production environment (see docker-compose.yml).
The logic was separated as a different service for the simulations and for the app, since the simulation could be very resource heavy and we dont want to overload the backend.

@github-actions
Copy link

github-actions bot commented Jul 4, 2025

AI Detection Analysis 🔍

Confidence Score: 35%

Reasoning:
The content in the pull request appears to be written with technical depth, clarity, and structure commonly seen in human-produced work, especially in the context of a development task or hiring assignment. The README, code structure, and even nuanced simulation logic demonstrate an understanding of system design, FastAPI, event-driven simulation using SimPy, and ML data pipeline design considerations. While some elements may resemble AI-generated documentation in terms of neatness and phrasing, the overall structure and adaptability evident throughout the code make a strong case for human authorship. There are also subtle spelling errors ("descrete" instead of "discrete", "sused" instead of "used") and customized logic handling that are less typical of AI-generated code but frequently occur in human submissions.

Key Indicators:

  • The README has logical and domain-specific motivation (e.g., base floor being busy), which suggests human thought and understanding.
  • Presence of nuanced business logic (e.g., entropy calculations, center of mass idea for request hotspots).
  • Clear familiarity with deployment best practices (e.g., docker-compose, separated services for load handling).
  • Comments and docstrings are informative and consistent with what experienced developers write, although at times a little "over-explained", which could suggest guidance assistance (e.g., light AI aid).
  • Some small spelling and grammar mistakes, which suggest lack of post-generation cleanup or that it's likely written directly by a human under deadline.
  • Usage of full simulation environment (SimPy), RESTful API integration, and task queuing logic, all pointing toward applied engineering considerations.

Overall, while there might be AI-assisted elements (e.g., schema docstrings or parts of README phrasing), the cohesive integration across simulation logic, API design, testing, and Docker deployment points to a strong likelihood of human authorship.

✅ No strong indicators of AI generation detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant