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

In peek show months per year used by the selected laws. #171

Open
mdrie opened this issue Dec 16, 2021 · 0 comments
Open

In peek show months per year used by the selected laws. #171

mdrie opened this issue Dec 16, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@mdrie
Copy link
Collaborator

mdrie commented Dec 16, 2021

Add a param which adds up the duration used by the laws accepted in one year according to the simulation. If this is shown as a chart, this would be very helpful to select / tune a realistic sequence of laws.

In PeekSimulator.createSimulation() within the while loop filter accLaws for the laws starting g.currentYear and sum the effort. Something like

const totalDuration = accLaws
  .filter((l) => l.effectiveSince === g.currentYear)
  .reduce((sum, l) => add(sum, l.effort(g).time), duration("P0M"))

It might have to be g.currentYear + 1 or g.currentYear -1, depending on where it is done and

@mdrie mdrie added the enhancement New feature or request label Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant