What's the config input to not mutate endTime at all? (MutateActivityTimeAllocation) #1219
Closed
fastGeorge
started this conversation in
General
Replies: 1 comment 1 reply
-
I think that the way to go would be to not use time mutation at all as a strategy. Something like not have a config section such as
Or set its weight to 0. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For my purposes, I don't want the endTimes or durations of activities in the simulations to be changed in MutateActivityTimeAllocation. In an attempt to achieve this, I set the mutationRange to 0 (config.timeAllocationMutator().setMutationRange(0)). However, this causes an issue in the method mutateTime. When mutationRange is set to 0, mutationRangeBins is also set to 0 which causes an error in this.random.nextInt(mutationRangeBins) since it expects input > 0. Is this the desired behaviour and should I disable endTime mutations in some other way? Thanks in advance!
private double mutateTime(final double time, double mutationRange) {
double t = time;
int mutationRangeBins = (int) Math.ceil( mutationRange/mutationRangeStep);
t = t - mutationRange + (2*this.random.nextInt(mutationRangeBins)*mutationRangeStep) ;
if (t < 0) {
t = 0;
}
// note that this also affects duration
return t;
}
Beta Was this translation helpful? Give feedback.
All reactions