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

Counts v2 format #2840

Merged
merged 41 commits into from
Nov 28, 2023
Merged

Counts v2 format #2840

merged 41 commits into from
Nov 28, 2023

Conversation

rakow
Copy link
Contributor

@rakow rakow commented Oct 11, 2023

This PR updates the counts format to v2 introducing more flexibility in the type of data that can be stored. In summary, the counts format can now store:

  • Any observations additional to counts (volumes)
  • Observations differentiated by mode
  • Data at any desired (but fixed) time interval

Example file:

<?xml version="1.0" encoding="UTF-8"?>
<counts xmlns="http://www.matsim.org/files/dtd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.matsim.org/files/dtd http://www.matsim.org/files/dtd/counts_v2.xsd" source="Bundesanstalt für Straßenwesen" name="BASt Counts" description="Aggregated daily traffic volumes for car and freight traffic." year="2021">

	<location refType="link" refId="2423" id="2423" name="Marienfelde_S">

		<measurements type="volumes" networkMode="car" interval="3600">
				<value t="0" val="56.28772173437474" />
				<value t="3600" val="34.67126398386528" />
				<value t="7200" val="37.18496486930159" />
<!-- Other values are left out... -->
		</measurements>
		<measurements type="volumes" networkMode="truck" interval="3600">
				<value t="0" val="11.100505172776847" />
				<value t="3600" val="9.51377028264906" />
				<value t="7200" val="12.541180784315472" />
<!-- Other values are left out... -->
				<value t="82800" val="14.506341987151561" />
		</measurements>
	</location>

The new API involves using createAndAddMeasureLocation, MeasurementLocation and Measurable (see javadoc on usage) instead of existing Count and Volume classes.

All changes are supposed to be backwards compatible, since the old Count and Volume classes are still present and functional.
They will internally use volume measurements of a one-hour interval for the mode car.

Closes #2780

@kainagel
Copy link
Member

Question: If it says "interval = 3600" and "t=3600", do you mean the time period from 0 to 3599, or from 3600 to 7199? I think that it should be the latter. (Otherwise, the second that is mentioned in the "t" entry would not even be part of the interval.) If this is already the case, it would help to have the examples start at "t=0". If this is not the case, then I really really think we should change it.

We had lots of problems with the fact that the old format started at 1 and not at 0. @mrieser , I think that you said the same two days ago.

This was referenced Oct 12, 2023
rakow added 4 commits October 13, 2023 14:12
# Conflicts:
#	contribs/cadytsIntegration/src/main/java/org/matsim/contrib/cadyts/general/CadytsBuilderImpl.java
@rakow rakow marked this pull request as draft October 16, 2023 15:36
@rakow rakow marked this pull request as ready for review November 28, 2023 10:28
@rakow rakow enabled auto-merge (squash) November 28, 2023 10:43
@rakow rakow merged commit de7b2a7 into master Nov 28, 2023
48 checks passed
@rakow rakow deleted the counts-v2 branch November 28, 2023 10:51
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.

More flexible counts format
3 participants