Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/telattar/live-long-and-prosper
Help a town reach a prosperity level of 100 by managing resources and constructing buildings.
https://github.com/telattar/live-long-and-prosper
Last synced: 9 days ago
JSON representation
Help a town reach a prosperity level of 100 by managing resources and constructing buildings.
- Host: GitHub
- URL: https://github.com/telattar/live-long-and-prosper
- Owner: telattar
- License: gpl-3.0
- Created: 2024-05-16T11:20:22.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-24T09:30:38.000Z (5 months ago)
- Last Synced: 2024-06-25T01:05:43.253Z (5 months ago)
- Language: Java
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Live Long and Prosper ποΈππ π
Help a town reach a prosperity level of 100 by managing resources and constructing buildings. Simulated in JAVA (OBJECT ORIENTED).
There is a town that requires some resources (food, materials, energy) for the citizens inside or for the establishment of new buildings. The town has a prosperity level indicating how well its people are doing. Buildings need to be established to make the town more prosperous and these buildings require some resources.This project attempts to find a plan that will make the prosperity level reach 100 using a search agent. The agent can perform Breadth-first Search, Depth-first search, Iterative deepening search, Uniform cost search, Greedy search with at least two heuristics, or Aβ search with at least two admissible heuristics. A trivial heuristic (e.g., h(n) = 1) is not acceptable.
## Classes
1. `GenericSearch.java`: Contains the main class implementing the generic search algorithm.
2. `LLAPSearch.java`: Provides helper methods for generating child nodes and updating the search queue based on the selected strategy.
3. `Node.java`: Defines the data structure for representing search nodes.
4. `Operator.java`: Enumerates possible operators for actions in the problem domain.
## Features
- Supports various search strategies: DF, ID, UC, BF, GR1, GR2, AS1, AS2.
- Provides visualization options for understanding the search process.
- Allows customization of problem parameters such as initial state, goal state, costs, and heuristic functions.
- Implements operators for actions like waiting, requesting food, materials, energy, and building.## Usage
1. Set up the initial state and problem parameters.
2. Choose a search strategy and specify whether to visualize the search process.
3. Call the `solve` method in `LLAPSearch.java` with the initial state, strategy, and visualization flag.
4. The method returns the solution path or "NOSOLUTION" if no solution is found.### VISUALIZATION
`visualize` is a Boolean parameter which, when set to true, results in the programβs side-effecting displaying the state information as it undergoes the different steps of the discovered solution (if one was discovered).## Example
```java
String initialState = "50, 50, 50, 50, 10, 10, 10, 5, 2, 5, 2, 5, 10, 1000, 20, 30, 40, 5, 10, 15, 20, 5, 10";
String strategy = "AS1";
boolean visualize = true;String solution = LLAPSearch.solve(initialState, strategy, visualize);
System.out.println("Solution: " + solution);
```Developed by a lovely team of three π₯°π₯°π₯°
Tarteel Elattar (Me)
[Dina Ayman](https://github.com/DinaAymann)
[Nora Osama](https://github.com/NoraOsama)