How mohamediliasskaddar/test-sma works
1. Overall purpose
ReserVibe is a Java multi-agent simulation built on JADE. It models a resource-allocation problem where multiple person agents try to reserve seats at multiple restaurant agents with limited capacity and possible line saturation. The architecture is centered on agent interaction rather than a traditional layered application.
2. Runtime and platform boundary
The main runtime dependency is JADE (lib/jade.jar), which provides the agent container, agent lifecycle, and inter-agent messaging. The project is a console-based simulation, so the observable output is primarily logs/statistics rather than a GUI or network service.
3. Entry and orchestration
Main.java is the likely bootstrap entrypoint. It delegates simulation setup to simulation/Simulation.java, which appears to configure the scenario, create agents, launch the JADE container, and collect results at the end. This is the top-level orchestration boundary.
4. Simulation subsystem
simulation/Simulation.java is the scenario manager. It owns the experiment parameters such as number of people, number of restaurants, and chosen strategy. It also appears responsible for generating restaurant capacities and saturation probabilities, then coordinating execution and summary reporting.
5. Agent hierarchy
agents/AgentBase.java is the shared abstraction for JADE agents in this system. AgentPersonne.java and AgentRestaurant.java specialize it into two roles: demand-side agents that search for reservations, and supply-side agents that accept or reject reservations based on capacity and line availability.
6. Person-agent flow
AgentPersonne drives the reservation attempt sequence. A person agent selects restaurants according to one of the strategies, sends reservation-related requests, counts attempts, and records whether it succeeded. This is the main consumer-facing side of the simulation.
7. Restaurant-agent flow
AgentRestaurant is the service endpoint for reservation requests. It maintains capacity, tracks occupancy/reservations, and simulates whether its phone line or intake is saturated. It responds to incoming requests with acceptance or refusal, making it the resource gatekeeper.
8. Strategy subsystem
The behaviours/ package contains the decision logic: ComportementGlouton, ComportementAleatoire, and ComportementCooperatif. These are behavior modules attached to person agents, letting the same agent type operate under different policies without changing the agent identity itself.
9. Strategy selection and configuration
enums/Strategie.java is the configuration boundary for choosing among the three behaviors. The simulation uses this enum to decide which behavior to attach or activate for person agents. This keeps strategy choice separate from agent implementation.
10. Cooperative data flow
The cooperative mode introduces peer-to-peer information sharing between agents. Instead of each person acting only on direct feedback, agents broadcast or reuse knowledge about saturated lines, unavailable restaurants, and successful reservations to reduce wasted calls. This is the only strategy that explicitly creates a shared-information channel.
11. Main interaction pattern
The primary data flow is: simulation initializes agents → person agents choose a restaurant via their behavior → request is sent to a restaurant agent → restaurant accepts or rejects based on capacity/saturation → person agent updates its state and possibly retries → simulation aggregates results. The architecture is therefore a closed-loop agent interaction model with centralized setup and decentralized decision-making.
12. Output and analysis boundary
At the end of execution, the simulation reports restaurant occupancy, number of calls per person, reservation success rate, and global efficiency metrics. These outputs are used to compare the three strategies rather than to drive further system behavior.
13. Key architectural characteristics
This repository is best understood as an experimental multi-agent model, not a business application. The important boundaries are: simulation orchestration, agent roles, strategy behaviors, and JADE runtime messaging. The design makes it easy to compare behavioral policies under the same restaurant-capacity constraints.
Main entry points: AgentPersonne.java Person agent · Simulation.java Simulation · AgentRestaurant.java Restaurant agent · Strategie.java Strategy enum
Components 11
Core simulation
Bootstrap and scenario orchestration
- Main · Application entrypoint
src/Main.java - Simulation · Sets up scenarios, agents, and results
src/simulation/Simulation.java - Strategy enum · Chooses which behavior policy to activate
src/enums/Strategie.java - Results · Aggregates occupancy, calls, and success metrics
src/simulation/Simulation.java
Agents
JADE agent roles and shared base
- Agent base · Shared JADE agent foundation
src/agents/AgentBase.java - Person agent · Searches restaurants and attempts reservations
src/agents/AgentPersonne.java - Restaurant agent · Manages capacity and reservation responses
src/agents/AgentRestaurant.java
Strategies
Behavior modules selected at runtime
- Greedy · Chooses restaurants by greedily pursuing reservations
src/behaviours/ComportementGlouton.java - Random · Selects restaurants randomly
src/behaviours/ComportementAleatoire.java - Cooperative · Shares information between person agents
src/behaviours/ComportementCooperatif.java
Connections 19
- Main → Simulation: starts · Bootstraps the simulation run
- Simulation → JADE: uses · Relies on JADE for agent lifecycle and messaging
- Simulation → Strategy enum: configures · Selects the strategy for each run
- Simulation → Person agent: creates · Instantiates demand-side agents
- Simulation → Restaurant agent: creates · Instantiates supply-side agents
- Agent base → Person agent: base for · Person agent specialization
- Agent base → Restaurant agent: base for · Restaurant agent specialization
- Person agent → Greedy: can use · Behavior attached under greedy strategy
- Person agent → Random: can use · Behavior attached under random strategy
- Person agent → Cooperative: can use · Behavior attached under cooperative strategy
- Strategy enum → Greedy: maps to · Strategy selection resolves to greedy behavior
- Strategy enum → Random: maps to · Strategy selection resolves to random behavior
- Strategy enum → Cooperative: maps to · Strategy selection resolves to cooperative behavior
- Person agent → Restaurant agent: requests · Sends reservation attempts to restaurants
- Restaurant agent → Person agent: responds · Accepts or refuses reservation requests
- Cooperative → Person agent: shares info · Enables peer knowledge exchange
- Simulation → Results: reports · Produces final occupancy and efficiency summaries
- Person agent → Results: contributes · Provides attempts and success outcomes
- Restaurant agent → Results: contributes · Provides occupancy and capacity outcomes