String getDebugDescription(boolean detailed) { if (size() == 0) { return "Empty FiringPlan!"; } StringBuilder description = new StringBuilder("Firing Plan for ").append(get(0).getShooter().getChassis()) .append(" at ") .append(getTarget().getDisplayName()) .append("; ").append(Integer.toString(size())) .append(" weapons fired "); if (detailed) { for (WeaponFireInfo weaponFireInfo : this) { description.append("\n\t\t").append(weaponFireInfo.getDebugDescription()); } } DecimalFormat decimalFormat = new DecimalFormat("0.00000"); description.append("\n\tTotal Expected Damage=").append(decimalFormat.format(getExpectedDamage())); description.append("\n\tTotal Expected Criticals=").append(decimalFormat.format(getExpectedCriticals())); description.append("\n\tKill Probability=").append(decimalFormat.format(getKillProbability())); description.append("\n\tUtility=").append(decimalFormat.format(getUtility())); return description.toString(); }
/** * Builds a {@link Vector} of all the actions, {@link EntityAction}, that make up this firing plan. * * @return The list of actions as a vector. */ synchronized Vector<EntityAction> getEntityActionVector() { Vector<EntityAction> actionVector = new Vector<>(); if (size() == 0) { return actionVector; } if(getTwist() != 0) { actionVector.add(new TorsoTwistAction(get(0).getShooter().getId(), FireControl.correctFacing(get(0).getShooter().getFacing() + getTwist()))); } if(flipArms) { actionVector.addElement(new FlipArmsAction(get(0).getShooter().getId(), flipArms)); } for (WeaponFireInfo weaponFireInfo : this) { actionVector.add(weaponFireInfo.getWeaponAttackAction()); } return actionVector; }
if((bombingPlan.size() > 0) && (bombingPlan.getUtility() > myPlan.getUtility())) { return bombingPlan;