Skip to content

Repository files navigation

MazeRunners Simulation

A multi-process, multi-threaded maze simulation system with WPF controller and autonomous console client workers communicating via Inter-Process Communication (IPC).

MazeRunners Code Editor


Key features

  • Dual-Channel IPC: separate named pipes (MazePipe_ServerIn / MazePipe_ServerOut) for inbound and outbound traffic to prevent stream corruption and isolate simulation load from the GUI.
  • In-app source code editor with built-in runtime C# compilation. Transmits custom binary assembly payloads (byte[]) over IPC for custom runner movement logic.
  • Maze Validation: checks maze for solvability, cycles, and boundaries.
  • Maze Passages: special maze tile that enforces movement in one direction only and blocks runner until all runners reach the tile.

Project Structure

./
├── AppGui/                   # WPF Application
│   ├── Views/Editor/         # Code editor window and runtime Roslyn compiler
│   ├── Presets/              # Preset maze configurations
│   └── PipeService.cs        # IPC server service for the WPF application
│
├── MazeCore/                 # Shared project (Core domain models and logic)
│   ├── Dto/                  # Data Transfer Objects used for IPC communication
│   ├── Ipc/                  # Inter-Process Communication utilities
│   ├── Models/               # Domain models
│   └── Validation/           # Maze validation rules
│
├── MazeCore.Tests/           # Unit tests for validation rules
│
├── RunnerCore/               # Shared project (Runner domain models and logic)
│   ├── MoveStrategies/       # Runner move strategy abstraction and basic random move implementation
│   ├── IMazeSimulation.cs    # Interface for simulation loop
│   ├── PipeClientService.cs  # IPC client service for the runner process
│   └── RunnerMoveResolver.cs # Validates and executes runner moves
│
├── MazeRunner.Thread/        # Console Client running MazeRunners using System.Threading.Thread
│
└── MazeRunner.TPL/           # Console Client running MazeRunners using Task Parallel Library

Getting Started

Clone the repository

git clone https://github.com/mgrablo/MazeRunners.git
cd MazeRunners

Build & Run

To compile all binaries, run the following command from the root solution folder:

dotnet build

To run the gui application, use:

dotnet run --project AppGui

When selecting TPL or Thread modes in the UI, the WPF application will spawn a separate runner process using the selected execution mode. This requires the runner executable to be available in the output directory.

You can also select Manual mode to run the runner process manually from the command line.

dotnet run --project MazeRunner.TPL

or

dotnet run --project MazeRunner.Thread

About

A multi-process, multi-threaded maze simulation system with WPF controller and autonomous console client workers communicating via Inter-Process Communication (IPC).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages