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

Default setting for 'mutationRangeStep ' #3647

Open
lukknapen opened this issue Dec 27, 2024 · 0 comments
Open

Default setting for 'mutationRangeStep ' #3647

lukknapen opened this issue Dec 27, 2024 · 0 comments

Comments

@lukknapen
Copy link

  • Does the default setting
   <module name="timeAllocationMutator" >
      <!-- Mutation Range Step, default = 1 second -->
      <param name="mutationRangeStep" value="1.0" />
   </module>

make sense ? In org/matsim/core/population/algorithms/PlanMutateTimeAllocation.java
and org/matsim/core/population/algorithms/PlanMutateTimeAllocationSimplified.java the second term in

double t = time.seconds() + (int)((this.random.nextDouble() * 2.0 - 1.0) * this.mutationRange);

always equals zero for the default setting due to the 'double to int' type casting.
Hence, the default value does not induce timeMutation.

This is because (int)(someDoubleValue) uses the 'rounding to zero method';
see https://docs.oracle.com/javase/specs/jls/se17/html/jls-5.html#jls-5.1.3

  • Was this default value chosen on purpose ? If so, it is useful to extend the comment for this setting in the logFile.log It now just says <!-- Mutation Range Step, default = 1 second --> which is correct but may be insufficient.
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

1 participant