public class PlanCompatibility
extends java.lang.Object
if (!PlanConpability.isVehicleCompatible(vehicle, plan))
System.err.println("The vehicle "+vehicle.getId()+" is not compatible with "+plan.getId);
Constructor and Description |
---|
PlanCompatibility() |
Modifier and Type | Method and Description |
---|---|
static java.util.Collection<java.lang.String> |
availablePayloads(VehicleType vehicle)
Calculate the payloads provided by a certain vehicle
|
static boolean |
isVehicleCompatible(VehicleType vehicle,
PlanType plan)
Checks vehicle compatibility with a plan
|
static void |
main(java.lang.String[] args) |
static java.util.Collection<java.lang.String> |
payloadsMissing(VehicleType vehicle,
PlanType plan)
Retrieve a list of payloads required by a vehicle that do not exist on the plan
|
static java.util.Collection<java.lang.String> |
payloadsRequired(PlanType plan)
Calculates the payloads required by a plan
|
static void |
testCompatibility(VehicleType vehicle,
PlanType plan)
Checks vehicle compatibility with a plan
|
public static boolean isVehicleCompatible(VehicleType vehicle, PlanType plan)
vehicle
- The vehicle to be checked for compatibilityplan
- The plan to test for compatibilitytrue
if the vehicle is compatible with given plan or false
if
the vehicle and plan are not compatible.public static void testCompatibility(VehicleType vehicle, PlanType plan) throws PayloadNotSupportedException, ManeuverNotSupportedException
vehicle
- The vehicle to be checked for compatibilityplan
- The plan to test for compatibilityPayloadNotSupportedException
- If the plan contains a payload configuration not supported by the vehicleManeuverNotSupportedException
- If the plan contains a maneuver not supported by the vehiclepublic static java.util.Collection<java.lang.String> payloadsMissing(VehicleType vehicle, PlanType plan)
vehicle
- The vehicle to check for payloadsplan
- The plan that lists required (active) payloadspublic static java.util.Collection<java.lang.String> payloadsRequired(PlanType plan)
plan
- Plan where to parse required payloadspublic static java.util.Collection<java.lang.String> availablePayloads(VehicleType vehicle)
vehicle
- The vehicle where to look for payloadspublic static void main(java.lang.String[] args)
Copyright © 2004-2020 FEUP-LSTS and Neptus developers. All Rights Reserved.