June 23rd, 2024

Picolisp a Railroad Simulation

A railroad simulation in PicoLisp uses Discrete Event Simulation (DES) to model trains as bots moving between stations, changing tracks, and shunting. Users control the simulation through logic and network layout files.

Read original articleLink Icon
Picolisp a Railroad Simulation

A railroad simulation using Discrete Event Simulation (DES) in PicoLisp is introduced, allowing users to create a model railroad experience in ASCII format. Trains are represented as bots with locomotives and wagons, moving between stations, changing tracks, and shunting. The simulation is controlled by two files: bahn.l for logic and plan.l for network layout and parameters. DES offers advantages over continuous simulation by dynamically determining train movements based on individual schedules. The simulation includes functions for train states (waiting, moving, shunting) and track elements, enabling complex layouts with loops and switches. The ASCII drawing and user interaction are managed by the display function, allowing users to navigate the simulation and toggle switches manually. By following examples and tweaking the code, users can create their own railway models using DES in PicoLisp, potentially enhancing the visual representation beyond ASCII.

Related

Smalltalk syntax in 7 minutes [video]

Smalltalk syntax in 7 minutes [video]

The YouTube video explains Smalltalk syntax, emphasizing readability and message-based object interaction. It covers keywords, arrays, closures, and method execution in Pharo Smalltalk, providing a practical example and additional learning resources.

X debut 40 years ago (1984)

X debut 40 years ago (1984)

Robert W. Scheifler introduced the X window system in June 1984 for the VS100 Unix server, offering improved performance over W. The system was stable, with the Laboratory for Computer Science already transitioning to X and developing applications. Scheifler encouraged experimentation and welcomed volunteers for documentation contributions.

Let's write a video game from scratch like it's 1987

Let's write a video game from scratch like it's 1987

Philippe Gaultier created Minesweeper in 1987 using X11 without libraries, resulting in a compact executable. The article explores X authentication, Odin language usage, and minimalistic GUI development, offering insights into X11 intricacies. Source code is on GitHub.

Wc2: Investigates optimizing 'wc', the Unix word count program

Wc2: Investigates optimizing 'wc', the Unix word count program

The GitHub project "wc2" presents an innovative algorithm for the `wc` program, focusing on asynchronous state-machine parsing in C and JavaScript. It enhances efficiency, scalability, and speed compared to traditional `wc` implementations.

SceneCraft: An LLM Agent for Synthesizing 3D Scenes as Blender Code

SceneCraft: An LLM Agent for Synthesizing 3D Scenes as Blender Code

SceneCraft is an advanced Large Language Model (LLM) Agent converting text to 3D scenes in Blender. It excels in spatial planning, asset arrangement, and scene refinement, surpassing other LLM agents in performance and human feedback.

Link Icon 8 comments
By @rob74 - 5 months
> However, for a comprehensive track network, a simple linked list of track elements is insufficient. It must be possible to traverse it in both directions and accommodate switches (turnouts) and loops. Loops present a particular challenge.

Fun fact: there is at least one track network (the Munich U-Bahn) that avoids loops and interconnecting lines "the wrong way around", so trains always face the same way (https://www-u--bahn--muenchen-de.translate.goog/fahrzeuge/?_...). Because of this, two-carriage trainsets have a "north carriage" and "south carriage", and the newer six-carriage trainsets have north and south end cars plus four middle cars. Of course, not all tracks run north-south, but the name is taken from the way the carriages point in the first (and at the moment still the only) maintenance yard in Fröttmaning.

By @interloxia - 5 months
>With some (considerable) effort, you could even replace the ASCII representation by something more visually appealing

Connect it to OSRD!

Open-Source Railway Designer (posted a few days ago) https://news.ycombinator.com/item?id=40733705

By @AstroJetson - 5 months
Late to this conversation but a favorite game with my children was Lego Loco

https://en.wikipedia.org/wiki/Lego_Loco

You could build little villages with train layouts. The big thing for them, is you could put tunnels that would connect to another user. It let you send trains and the mail card had "post cards" you could send messages.

I miss it.

By @ngcc_hk - 5 months
Doing one using lua and love2d and hence found some difference or things to ponder

- use ds and discrete event simulation instead of the usual dt (and continuous …)? Why? Seems all game engine offer dt …

- shall the track be one way and if two way traffic has to use 2 tracks? Otherwise if >1 train or train-group … crash ? And if there are junction … route and timing would be issues otherwise crash ?

- picolisp vs fennel ?

By @greathones - 5 months
Any link to blogs/materials about programming train simulation (like in openttd)?
By @W-Stool - 5 months
No one interested in railroad simulations running Run8 here?
By @taddevries - 5 months
I'm just gonna say that I belive Factorio is the best railroad simulator. Second only to OpenTTD.
By @nathan_compton - 5 months
Picolisp - what a weird thing. I have to admire the temerity of a guy who in 2023 is still team "dynamic scope is better."