+ /**
+ * Return the total mass of the motors
+ *
+ * @param configuration the current motor instance configuration
+ * @return the total mass of all motors
+ */
+ @Override
+ public double getPropellantMass(Configuration configuration, MotorInstanceConfiguration motors){
+ double mass = 0;
+
+ // add up the masses of all motors in the rocket
+ if (motors != null) {
+ for (MotorId id : motors.getMotorIDs()) {
+ MotorInstance motor = motors.getMotorInstance(id);
+ mass = mass + motor.getCG().weight - motor.getParentMotor().getEmptyCG().weight;
+ }
+ }
+ return mass;
+ }