public ProbableStrength Better(ProbableStrength other) { if (strength * weight < other.strength * other.weight) return other; return this; }
public ProbableStrength Relative(ProbableStrength other) { double newstrength = other.strength * strength; // <- use instead of RelativeStrength(other.strength, strength), because only used for strength [0, 1] double newweight = RelativeWeight(other.weight, weight); return(new ProbableStrength(newstrength, newweight)); }
public ProbableStrength Combine(ProbableStrength other) { double newstrength = (strength * weight + other.strength * other.weight) / (weight + other.weight); double newweight = weight + other.weight - weight * other.weight; return(new ProbableStrength(newstrength, newweight)); }
public static ProbableStrength Max(ProbableStrength one, ProbableStrength two) { if (one.strength * one.weight > two.strength * two.weight) return one; else return two; }
public ProbableStrength Better(ProbableStrength other) { if (strength * weight < other.strength * other.weight) { return(other); } return(this); }
public static ProbableStrength Max(ProbableStrength one, ProbableStrength two) { if (one.strength * one.weight > two.strength * two.weight) { return(one); } else { return(two); } }
public ProbableStrength Improve(ProbableStrength other) { if (other.strength > strength) { double newstrength = strength + (other.strength - strength) * other.weight / (weight + other.weight); double newweight = (weight + other.weight) / 2; return(new ProbableStrength(newstrength, newweight)); } else { return(this); } }
public void ImproveStrength(ProbableStrength addStrength, ref double strengthFactor) { ImproveStrength(addStrength.strength, addStrength.weight, ref strengthFactor); }
public ProbableStrength Combine(ProbableStrength other) { double newstrength = (strength * weight + other.strength * other.weight) / (weight + other.weight); double newweight = weight + other.weight - weight * other.weight; return new ProbableStrength(newstrength, newweight); }
public ProbableStrength Relative(ProbableStrength other) { double newstrength = other.strength * strength; // <- use instead of RelativeStrength(other.strength, strength), because only used for strength [0, 1] double newweight = RelativeWeight(other.weight, weight); return new ProbableStrength(newstrength, newweight); }
public ProbableStrength Improve(ProbableStrength other) { if (other.strength > strength) { double newstrength = strength + (other.strength - strength) * other.weight / (weight + other.weight); double newweight = (weight + other.weight) / 2; return new ProbableStrength(newstrength, newweight); } else return this; }