/** * @return true if input {@link ResourceRequirement} exceeds the hard bound long any dimension. If the parameter * orEqual is true, then matching along any dimension will also return true. */ public boolean exceedsHardBound(ResourceRequirement requirement, boolean orEqual) { return VectorAlgebra.exceedsVector(this.hardBound, requirement.getResourceVector(), orEqual); }
/** * @return true if input {@link ResourceRequirement} exceeds the soft bound long any dimension. If the parameter * orEqual is true, then matching along any dimension will also return true. */ public boolean exceedsSoftBound(ResourceRequirement requirement, boolean orEqual) { return VectorAlgebra.exceedsVector(this.softBound, requirement.getResourceVector(), orEqual); }
@Test public void testExceedsVector() throws Exception { Assert.assertTrue(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{0, 3}, false)); Assert.assertTrue(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{2, 0}, false)); Assert.assertTrue(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{0, 2}, true)); Assert.assertTrue(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{1, 0}, true)); Assert.assertFalse(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{0, 1}, false)); Assert.assertFalse(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{1, 2}, false)); } }
/** * @return true if input {@link ResourceRequirement} exceeds the soft bound long any dimension. If the parameter * orEqual is true, then matching along any dimension will also return true. */ public boolean exceedsSoftBound(ResourceRequirement requirement, boolean orEqual) { return VectorAlgebra.exceedsVector(this.softBound, requirement.getResourceVector(), orEqual); }
/** * @return true if input {@link ResourceRequirement} exceeds the hard bound long any dimension. If the parameter * orEqual is true, then matching along any dimension will also return true. */ public boolean exceedsHardBound(ResourceRequirement requirement, boolean orEqual) { return VectorAlgebra.exceedsVector(this.hardBound, requirement.getResourceVector(), orEqual); }