How felipe-cerv/jarras-busqueda-ciega works
Main Components
• Core Search Module:
• Component: BusquedaCiega (located at IA/BusquedaCiega.py)
• Role: Implements the blind search algorithm (specifically breadth-first search) to navigate through different states of the jugs.
• Action Module:
• Component: Acciones (directory with Acciones.py and __init__.py)
• Role: Defines the actions that can be applied to the current state of the jugs. It contains a function that receives a list (representing the current state) and randomly selects an action, returning a new state after applying the action.
• State Representation:
• Although not explicitly present as a separate module, the state of the jugs is an implicit component, and it is what ties together the actions with the search algorithm.
Relationships and Interactions
• BusquedaCiega is the orchestrator that uses the functions provided by the Acciones module to generate successor states.
• The search algorithm repeatedly applies a random action (selected by the Acciones module) to the current state.
• There is a cyclical relationship: the search module takes a state, passes it to the actions module, receives an updated state, and then evaluates whether the solution is reached, continuing the process accordingly.
Important Architectural Patterns
• Separation of Concerns: Clear segregation between the algorithm (BusquedaCiega) and the state mutation logic (Acciones).
• Modularity: Each module has a distinct role. This is especially beneficial if further enhancements (e.g., adding other search algorithms or refining the actions) are needed.
• Randomized Action Selection: Although the basic algorithm is non-deterministic (i.e., random action selection), it adheres to the structure needed for a breadth-first search in state-space exploration.
Relevant Technologies and Design Principles
• Python as the core programming language.
• Fundamental design principles such as modular programming and separation of concerns.
• If later extended, additional libraries (for visualization or logging) could be integrated without changing the basic architectural layout.
Specific Elements
• Each main component should be clearly labeled (e.g., “BusquedaCiega Module”, “Acciones Module”, “State Representation”).
• BusquedaCiega → Acciones: indicating that the search algorithm calls the actions function.
• Acciones → BusquedaCiega: showing the feedback loop where a new state is returned to the search algorithm.
• Optionally, include a “State Space” node that represents the evolving configurations of the jugs.