summaryrefslogtreecommitdiff
path: root/docs/simulation-builder-framework.md
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-22 16:52:45 +0300
committerPaul Buetow <paul@buetow.org>2025-06-22 16:52:45 +0300
commit7e2f6f2a927a249327be28442b2c7b78b74850a9 (patch)
tree1c877658da9dd5053cc3c356c4c368837efcb6be /docs/simulation-builder-framework.md
parent4c16cc3c4da7bbf8375d7951185db1761eb396bf (diff)
Update and organize documentation
- Renamed all uppercase markdown files to lowercase for consistency - ARCHITECTURE.md -> architecture.md - DEVELOPER_GUIDE.md -> developer-guide.md - TIMESTAMP_EVENTS_GUIDE.md -> timestamp-events-guide.md - SERIALIZATION_NOTES.txt -> serialization-notes.txt - Removed all Raft references from documentation - Updated build-fixes-summary.md - Updated testing-guide.md - Updated test-infrastructure.md - Updated simulation-builder-framework.md - Created index.md for easy documentation navigation - Organized docs by category (Architecture, Testing, GUI Decoupling, etc.) - Added quick links for different user types - Included documentation standards and contribution guidelines All documentation is now consistent and up-to-date with the current codebase. 🤖 Generated with Claude Code https://claude.ai/code Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'docs/simulation-builder-framework.md')
-rw-r--r--docs/simulation-builder-framework.md30
1 files changed, 11 insertions, 19 deletions
diff --git a/docs/simulation-builder-framework.md b/docs/simulation-builder-framework.md
index a5a27d1..f9c6385 100644
--- a/docs/simulation-builder-framework.md
+++ b/docs/simulation-builder-framework.md
@@ -13,7 +13,7 @@ The core builder class that provides a fluent API for creating simulations:
```java
new SimulationBuilder()
.withProcesses(5)
- .withProtocol("protocols.implementations.VSRaftProtocol")
+ .withProtocol("protocols.implementations.VSTwoPhaseCommitProtocol")
.withDuration(20000)
.activateServers(0, 1, 2)
.activateClients(1000, 3, 4)
@@ -27,15 +27,7 @@ new SimulationBuilder()
Factory methods for common simulation patterns:
```java
-// Create a standard 3-server Raft cluster
-SimulationFactory.createRaftSimulation(3, 0)
- .save("saved-simulations/raft.dat");
-
-// Create a Raft cluster with fault tolerance testing
-SimulationFactory.createRaftFaultToleranceSimulation(5)
- .save("saved-simulations/raft-fault-tolerant.dat");
-
-// Other protocols
+// Create common simulation patterns
SimulationFactory.createPingPongSimulation(2);
SimulationFactory.createBerkeleyTimeSimulation(4);
SimulationFactory.createTwoPhaseCommitSimulation(3);
@@ -85,13 +77,13 @@ The framework:
## Usage Examples
-### Basic Raft Simulation
+### Basic Two-Phase Commit Simulation
```java
new SimulationBuilder()
.withProcesses(3)
- .withProtocol(SimulationBuilder.Protocols.RAFT)
+ .withProtocol(SimulationBuilder.Protocols.TWO_PHASE_COMMIT)
.activateServers(0, 1, 2)
- .save("saved-simulations/raft.dat");
+ .save("saved-simulations/2pc.dat");
```
### Complex Scenario
@@ -106,17 +98,17 @@ new SimulationBuilder()
.addRecoveryEvent(2, 8000) // Server 2 recovers
.addCrashEvent(0, 10000) // Leader crashes
.addRecoveryEvent(0, 12000) // Leader recovers
- .save("saved-simulations/raft-complex.dat");
+ .save("saved-simulations/complex-scenario.dat");
```
## Created Simulations
-Using this framework, we successfully created:
+Using this framework, you can create:
-1. **raft.dat** - Basic 3-node Raft cluster
-2. **raft-with-clients.dat** - Raft with 3 servers and 2 clients
-3. **raft-fault-tolerant.dat** - 5 servers with crash/recovery events
-4. **raft-complex.dat** - 7 processes with complex fault scenarios
+1. **ping-pong.dat** - Basic 2-node ping-pong communication
+2. **2pc.dat** - Two-phase commit with coordinator and participants
+3. **broadcast.dat** - Reliable broadcast protocol simulation
+4. **berkley-time.dat** - Berkeley time synchronization
## Verification