Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To see the ambulance index dispatched in the output-file? #75

Open
dsa27solver opened this issue May 5, 2024 · 3 comments
Open

To see the ambulance index dispatched in the output-file? #75

dsa27solver opened this issue May 5, 2024 · 3 comments

Comments

@dsa27solver
Copy link

Hello Sam,

Could you help me with this question? How can I see the ambulance (index) that has been sent to every emergency call (with call-index also shown)? And also the time of every ambulance dispatched? Can I see all these data in the output-file “calls.csv”?

Thank you in advance for your attention. Best regards.
Daniel

@samridler
Copy link
Collaborator

Hi Daniel,
I think that the ambulance sent to an emergency call is stored on each call with call.ambIndex but it is not written to the calls.csv.
As for the time of every ambulance dispatch, each call records when the final ambulance dispatched to the call occurred with call.dispatchTime, but if any ambulance is re-dispatched from one call to another then the first dispatch time will not be recorded.

@dsa27solver
Copy link
Author

Thank you very much Sam for your answer. Is there any way to add the "call.ambIndex" data in the output file "calls.csv"?
Best regards.

@samridler
Copy link
Collaborator

samridler commented May 8, 2024

You can set the call.attributes before calling writeStatsFiles(sim) to write additional fields to the calls.csv, though it will all be put in a single column where each cell has type Dict{String,Any}.
To set the call.attributes use:

for call in sim.calls
    call.attributes["ambIndex"] = call.ambIndex
end

though if the simulation has multiple replications then use:

for rep in sim.reps, call in rep.calls
    call.attributes["ambIndex"] = call.ambIndex
end

If that doesn't work for you then I could try add the ambIndex as a column in calls.csv.

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

No branches or pull requests

2 participants