[Issue 528] Make cluster point process code more general by fixing hard coded values#937
Open
CodersRepo wants to merge 1 commit into
Open
Conversation
Comment on lines
+11
to
+24
| from PyQt5.QtWidgets import ( | ||
| QApplication, | ||
| QWidget, | ||
| QLabel, | ||
| QLineEdit, | ||
| QPushButton, | ||
| QVBoxLayout, | ||
| QFileDialog, | ||
| QMessageBox, | ||
| QDialog, | ||
| QDialogButtonBox, | ||
| QGridLayout, | ||
| ) | ||
|
|
| if prototype_weights is not None and len(prototype_weights) == 0: | ||
| prototype_weights = None | ||
|
|
||
| ratio_sum = sum(float(v) for v in type_ratios.values()) |
Comment on lines
+109
to
+110
| graph_attribute = graph.nodes[gid]["segments"] | ||
| graph_grid = np.array(eval(graph_attribute)) |
Comment on lines
+376
to
+380
| if abs(wsum - 1.0) > 0.02: | ||
| QMessageBox.warning( | ||
| self, | ||
| "Input Error", | ||
| f"Prototype weights should sum to 1.0 (currently {wsum:g}).", |
|
|
||
| Parameters mirror the GUI fields. prototype_weights maps each prototype key to a | ||
| relative frequency (need not sum to exactly 1; values are normalized). If None, | ||
| legacy 40/50/9/1%% weights apply when there are exactly four prototypes; otherwise |
Comment on lines
+140
to
+142
| s = w.sum() | ||
| if s <= 0: | ||
| raise ValueError("prototype weights must sum to a positive value") |
| "Minimum Duration (seconds):", # The shortest duration of a 911 call or incident in the dataset, measured in seconds. This could be used to filter out very short or incomplete calls. | ||
| "Mean Patience Time (seconds):", # The average time a caller is willing to wait on hold before hanging up, measured in seconds. This metric is important for understanding caller behavior and optimizing call center operations. | ||
| "Mean On-Site Time (seconds):", # The average time emergency responders spend on-site at an incident, measured in seconds. This includes the time from arrival at the scene to departure. | ||
| "Random seed (optional, blank for non-deterministic):", # Integer seed for numpy.random; leave blank for unpredictable runs. |
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.
…ph path
Closes #528
Description
Cluster point process: configurable params, JSON CLI, fix ignored graph path
Use the graph file chosen in the UI instead of a hardcoded spd.graphml path.
Add generate_cluster_point_process_xml() for shared GUI/CLI generation with
optional RNG seed, prototype selection weights, and XML clock attributes.
Extend secprocess() with optional prototype_weights; keep legacy 40/50/9/1
weights for four prototypes when weights are omitted; factor Tukey fence
constant. Add --config for headless runs from JSON; validate graph path and
fix mismatched error labels.
Checklist (Mandatory for new features)
Testing (Mandatory for all changes)
test-medium-connected.xmlPassedtest-large-long.xmlPassed