Skip to content

[Issue 528] Make cluster point process code more general by fixing hard coded values#937

Open
CodersRepo wants to merge 1 commit into
SharedDevelopmentfrom
issue-528-fixing-hard-coded-cluster-point-process-code
Open

[Issue 528] Make cluster point process code more general by fixing hard coded values#937
CodersRepo wants to merge 1 commit into
SharedDevelopmentfrom
issue-528-fixing-hard-coded-cluster-point-process-code

Conversation

@CodersRepo
Copy link
Copy Markdown

@CodersRepo CodersRepo commented May 14, 2026

…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)

  • Added Documentation
  • Added Unit Tests

Testing (Mandatory for all changes)

  • GPU Test: test-medium-connected.xml Passed
  • GPU Test: test-large-long.xml Passed

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants