Closed LoganJohnson closed 8 years ago
/Users/vagrant/git/DiceKit/FrequencyDistribution.swift:241:42: error: cannot convert return expression of type 'OutcomeType' to expected return type 'Int'
return self.orderedOutcomes.last ?? 0
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
Another reason we can't change it to 0
. Just return as is :smile:
Sourcetree's “amend last commit” is funky. I’ll be squashing this down after it's approved.
This looks good, for FrequencyDistribution
. Do you plan on one PR for this, ProbabilityMass
, ExpressionType
, and ExpressionResultType
?
If so, FrequencyDistribution
and ProbabilityMass
would be one commit and the other commit would be the expression.
Yeah adding ProbabilityMass
to this PR makes sense. I'll do that quick now.
I have the initial groundwork for expressions laid out in the latest commit, but I'm running into trouble fully implementing it. Determining the value
within the MinimizationExpressionResult means that you would need to pass through a probabilityMass to be able to pull a minimumOutcome()
from it. I'll be working on this later tonight so feedback tonight would be awesome.
I took the day off yesterday. I'll try to look at this today, but it might have to be after D&D Tuesday (so, Wednesday).
But, without looking at it, I think it would work this way:
probabilityMass
, which lives in Expression
, yes, get the min/max from the probabilityMass
of the base
expression. Then just make a new ProbabilityMass
with that constant. Done.value
we would simply return the value given to us in initialization.Almost there!
Can you add a section to the CHANGELOG? Also, adding something to the playground would be swell as well.
Resolving these conflicts tonight. Got too late last night.
It will be nice to have this.
Can you add something to the CHANGELOG?
Also, do you plan on making a new page for "operations", since min/max will be the first one? (You don't have to, someone else can as well)
Alright I think we are good here? I'll squash it after a review.
@LoganJohnson cleanup the issues pointed out and then squash. Then when the build passes CI you can merge it.
Right now the implementation is super simple, which isn't necessarily a bad thing.
Ideas on tests would be awesome too.
Closes #64