How cylin928/hydrocnhs works
HydroCNHS is a Python framework for semi-distributed hydrological simulation coupled with human/agent behavior. The main workflow is to configure a basin model, run rainfall–runoff and routing with optional agent interventions, and collect results; sediment simulation and calibration extend that workflow. The graph preserves the documented Dam, RiverDiv, Conveying, and InSitu APIs, plus model-building and analysis capabilities. Some integrations are documented but their implementation was not sampled, so those relationships are cited to the README; unsampled call details are not inferred.
Main entry points: hydrocnhs.py Coupled simulator · model_builder.py Model builder · abm_script.py Agent templates · convertor.py Parameter convertor
Components 21
Model configuration
- Model builder
src/hydrocnhs/model_builder.py - Configuration utilities
src/hydrocnhs/util.py
Hydrological simulation
- Coupled simulator
src/hydrocnhs/hydrocnhs.py - ABCD runoff
src/hydrocnhs/rainfall_runoff_model/abcd.py - GWLF runoff
src/hydrocnhs/rainfall_runoff_model/gwlf.py - Hamon PET
src/hydrocnhs/rainfall_runoff_model/pet_hamon.py - Flow routing
src/hydrocnhs/routing.py - Sediment model
src/hydrocnhs/water_quality_model/sediment.py
Human and agent models
- Agent runtime
src/hydrocnhs/abm.py - Agent templates
src/hydrocnhs/abm_script.py - Dam API
src/hydrocnhs/hydrocnhs.py - RiverDiv API
src/hydrocnhs/hydrocnhs.py - Conveying API
src/hydrocnhs/hydrocnhs.py - InSitu API
src/hydrocnhs/hydrocnhs.py
Calibration
- Parameter convertor
src/hydrocnhs/calibration/convertor.py - Genetic algorithm
src/hydrocnhs/calibration/ga_deap.py
Results and analysis
- Data collector
src/hydrocnhs/data_collector.py - Performance indicators
src/hydrocnhs/indicators.py - Visualization
src/hydrocnhs/visual.py - Simulation results
Other components
- Modeler
Connections 22
- Modeler → Model builder: configures model
README.md - Model builder → Agent templates: creates templates
src/hydrocnhs/model_builder.py - Modeler → Coupled simulator: runs model
README.md - Coupled simulator → ABCD runoff: runs runoff
src/hydrocnhs/hydrocnhs.py - Coupled simulator → GWLF runoff: runs runoff
src/hydrocnhs/hydrocnhs.py - Coupled simulator → Hamon PET: calculates PET
src/hydrocnhs/hydrocnhs.py - Coupled simulator → Flow routing: routes flow
src/hydrocnhs/hydrocnhs.py - Coupled simulator → Sediment model: runs sediment
src/hydrocnhs/hydrocnhs.py - Coupled simulator → Agent runtime: runs agents
- Coupled simulator → Dam API: integrates actions
README.md - Coupled simulator → RiverDiv API: integrates actions
README.md - Coupled simulator → Conveying API: integrates actions
README.md - Coupled simulator → InSitu API: integrates actions
README.md - Agent templates → Agent runtime: uses runtime
src/hydrocnhs/abm_script.py - Modeler → Parameter convertor: sets parameters
README.md - Parameter convertor → Genetic algorithm: formats parameters
- Genetic algorithm → Coupled simulator: evaluates model
- Coupled simulator → Data collector: collects outputs
src/hydrocnhs/hydrocnhs.py - Coupled simulator → Simulation results: produces results
README.md - Simulation results → Performance indicators: analyzes results
README.md - Performance indicators → Visualization: supports plotting
src/hydrocnhs/visual.py - Data collector → Simulation results: stores outputs