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

Dedicated result type for Event.probability() #119

Open
mdrie opened this issue Sep 27, 2021 · 0 comments
Open

Dedicated result type for Event.probability() #119

mdrie opened this issue Sep 27, 2021 · 0 comments
Labels
enhancement New feature or request later

Comments

@mdrie
Copy link
Collaborator

mdrie commented Sep 27, 2021

As documented here:

* Three possible values-ranges and their meanings are
the method Event.probability() returns a number which may have 3 different meanings - making this longish documentation necessary in the first place...

A two-part return value is needed indicating with the first part if

  • the event is currently not possible,
  • may occur with a given probability, or
  • has to occur with a given priority.

and with the second part the probability or priority.

This is probably not correct TS, but might illustrate the idea:

type EventProbability = "impossible"
                      | "possible" & { probability: 0..100 }
                      | "inevitable" & { priority: number }

Some nice generator functions for easy usage in the events would be helpful.

While doing this, the probability shall be changed from Ratio (i.e. value between 0 and 1) to Percent (0%..100%).

@mdrie mdrie added the enhancement New feature or request label Sep 27, 2021
@mdrie mdrie added the later label Oct 8, 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 later
Projects
None yet
Development

No branches or pull requests

1 participant