this.expected = this.odds * this.value; this.primary_expected = this.primary_odds * this.value;
this.expected = this.value/this.primary_odds; this.expected = this.expected * this.odds;
    public AttackOption(CEntity target, Mounted weapon, double value, ToHitData toHit) {        this.target = target;        this.weapon = weapon;        this.toHit = toHit;        this.value = value;        if (target != null) {            WeaponType w = (WeaponType) weapon.getType();            this.primary_odds = Compute.oddsAbove(toHit.getValue()) / 100.0;            this.odds = Compute.oddsAbove(toHit.getValue() + 1) / 100.0;            this.heat = w.getHeat();            this.expected = this.odds * this.value;            this.primary_expected = this.primary_odds * this.value;            final boolean isInfantryWeapon = ((w.getFlags() & WeaponType.F_INFANTRY) == WeaponType.F_INFANTRY);            final boolean usesAmmo = (!isInfantryWeapon && w.getAmmoType() != AmmoType.T_NA);            final Mounted ammo = usesAmmo ? weapon.getLinked() : null;            if (usesAmmo && (ammo == null || ammo.getShotsLeft() == 0)) {                this.value = 0; //should have already been caught...            } else if (usesAmmo) {                this.ammoLeft = ammo.getShotsLeft();            }        }    }