diff --git a/22.5.jar b/22.5.jar new file mode 100644 index 0000000..9729599 Binary files /dev/null and b/22.5.jar differ diff --git a/core/src/MyStrategy.java b/core/src/MyStrategy.java index 2dc1c0a..a8d47bf 100755 --- a/core/src/MyStrategy.java +++ b/core/src/MyStrategy.java @@ -356,13 +356,19 @@ private PlainArray calcMap(VehicleGroupInfo group) { //TODO improve logic at fin if (myArrvs.isEmpty()) { addToArrayNotOurFacilities(plainArray, range, 1, group); } else { - HashSet> entries = new HashSet<>(myArrvs); - for (Map.Entry en : entries) { - en.setValue(1); + VehicleGroupInfo maxArrvG = myGroups.stream().filter(g -> g.vehicleType == ARRV).max(Comparator.comparingInt(g -> g.vehicles.size())).orElse(null); + + HashSet> entries = new HashSet<>(); + if (maxArrvG != null) { + entries.add(new AbstractMap.SimpleEntry<>(maxArrvG.getCellAveragePoint(), 1)); + } else { + entries.addAll(myArrvs); + for (Map.Entry en : entries) { + en.setValue(1); + } } - //TODO go to single point + addToArray(plainArray, entries, range, .1f); - addToArray(plainArray, myArrvs, range, .1f); } } else { @@ -451,12 +457,18 @@ private PlainArray calcMap(VehicleGroupInfo group) { //TODO improve logic at fin if (myIfvs.isEmpty()) { addToArrayNotOurFacilities(plainArray, range, 1, group); } else { - HashSet> entries = new HashSet<>(myIfvs); - for (Map.Entry en : entries) { - en.setValue(1); + VehicleGroupInfo maxIfvG = myGroups.stream().filter(g -> g.vehicleType == IFV).max(Comparator.comparingInt(g -> g.vehicles.size())).orElse(null); + + HashSet> entries = new HashSet<>(); + if (maxIfvG != null) { + entries.add(new AbstractMap.SimpleEntry<>(maxIfvG.getCellAveragePoint(), 1)); + } else { + entries.addAll(myIfvs); + for (Map.Entry en : entries) { + en.setValue(1); + } } - //TODO go to single point - addToArray(plainArray, myIfvs, range, .1f); + addToArray(plainArray, entries, range, .1f); } } @@ -873,7 +885,7 @@ private void addToArrayNotOurFacilities(PlainArray plainArray, double range, flo addToArray(plainArray, fc.get(-1L).get(VEHICLE_FACTORY).entrySet(), range, factor); } else { HashSet> counts = new HashSet<>(); - counts.add(new AbstractMap.SimpleEntry(group.goToFacility.getCenterCellPos(), 1)); + counts.add(new AbstractMap.SimpleEntry<>(group.goToFacility.getCenterCellPos(), 1)); addToArray(plainArray, counts, range, factor); } } diff --git a/core/src/Runner.java b/core/src/Runner.java index d333f98..f6400e8 100755 --- a/core/src/Runner.java +++ b/core/src/Runner.java @@ -39,7 +39,8 @@ public static void main(String[] args) throws IOException { //runProc(null, true, "java", "-cp", "19.jar", "Runner"); //runProc(null, true, "java", "-cp", "21.jar", "Runner"); //runProc(null, true, "java", "-cp", "22.jar", "Runner"); - runProc(null, true, "java", "-cp", "22.3.jar", "Runner"); + //runProc(null, true, "java", "-cp", "22.3.jar", "Runner"); + runProc(null, true, "java", "-cp", "22.4.jar", "Runner"); } }).start(); new Runner(new String[]{"127.0.0.1", hasArgs ? "31001" : "31002", "0000000000000000"}).run();