Open
Conversation
…n parameters. - Added hundreds of first and last names to resources for more varied victim generation. - Updated `GenerateFullNames.java` to robustly load names from classpath or filesystem. - Refactored `Disaster.java` to use configurable simulation parameters (people count, medical needs, boat capacity, etc.) and a shared Random instance. - Updated `MainVerticle.java` and `HttpApplication.java` to load these parameters from configuration with sensible defaults. - Updated `Main.java` CLI to use the new name files by default. - Fixed a NullPointerException in `BoundingPolygons` by initializing a default inclusion polygon. - Verified CLI mode functionality and updated tests. Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
…utes. - Added fields to `Victim.java`: age, gender, pregnant, conscious, mobility, priority. - Added fields to `Responder.java`: type, speed. - Refactored `Disaster.java` to implement complex generation logic for these new attributes, including correlations (e.g., age vs mobility) and priority scoring. - Added corresponding configuration keys to `MainVerticle.java` and `HttpApplication.java`. - Updated `BoundingPolygons` with a default constructor to prevent crashes in CLI mode. - Verified changes with CLI execution and tests. Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
- Created `DataScraper` and `ScrapedData` to load and hold regional statistics. - Updated `Disaster.java` to apply scraped data metrics to simulation parameters. - Updated `Main.java` CLI to support `-s` flag for loading scraped data. - Added mock scraped data file `gulf_response_data.json` for testing. - Verified changes with CLI execution and tests. Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
…ata integration. - **GeoJSON Support**: Created `GeoJsonLoader` and `Zone` to support weighted, multi-zone generation from map files. Updated `BoundingPolygons` to use this logic. - **Improbability Factors**: Added `ImprobabilityFactor` model to simulate complex risk scenarios (unrest, exploitation, crime) affecting response. - **Data Integration**: Enhanced `DataScraper` and `Disaster` to adjust simulation parameters based on external "scraped" data (JSON) and risk factors. - **Elaborate Simulation**: Added `Victim` attributes (age, gender, pregnancy, consciousness, mobility) and `Responder` attributes (type, speed) with correlated generation logic. - **Configuration**: Updated `MainVerticle` and `HttpApplication` to fully support configuration of these new features via config files or CLI arguments. - **CLI Updates**: Added `--scrape` and `--geojson` (or `-map`) flags to the CLI for easy testing. - **Data**: Added sample `wilmington.geojson` and `chaos_scenario.json` resources. Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
…399330413336946 Enhance disaster simulator with more names and configurable simulation parameters
- Added `org.dyn4j:dyn4j:4.1.4` dependency. - Implemented `PhysicsSimulation` wrapper around Dyn4j World. - Implemented `CoordinateConverter` for Geodetic to Cartesian mapping. - Implemented `ImageRenderer` for visualizing simulation steps. - Updated `Main.java` to include CLI options for running the physics simulation. - Exposed `inclusionZones` in `BoundingPolygons.java`. Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
…966059394 Integrate Dyn4j Physics Engine and Image Generation
- Removed log statement that printed the full response body from the disaster service. - Improved logging of inclusion polygons by logging the point count instead of the array object reference. Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
Replaced repeated `new Random()` instantiation with `ThreadLocalRandom.current()` in `GenerateFullNames.java` to reduce object allocation overhead and improve performance. Measured an average execution time reduction of ~56% for name generation (from ~250 ns/call to ~110 ns/call) over 10 million iterations. Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
The exception message in setLongitude incorrectly referred to "Latitude" instead of "Longitude". This has been corrected. Added a unit test WaypointTest to verify the exception messages for both setLatitude and setLongitude. Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
This commit adds a comprehensive test suite for the Disaster class in `src/test/java/com/redhat/cajun/navy/datagenerate/DisasterTest.java`. The tests cover: - Victim generation and properties - Responder generation and properties - Application of ScrapedData and its impact on generation parameters - Bulk generation of victims and responders - Priority calculation logic for various edge cases (unconsciousness, pregnancy, etc.) - Biased random distribution range The tests follow the existing patterns for resource loading and assertions. Logs and temporary build artifacts were cleaned up. Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
…7931 🧪 Add test for Disaster logic
…567810525527094 🧹 fix misleading exception message in Waypoint.java
…99607298103233 ⚡ Optimize random name generation with ThreadLocalRandom
…985007484193411270 🔒 fix full response body logging in HttpApplication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
added features