Skip to content

Commit

Permalink
- 23 new scale
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry committed Dec 14, 2017
1 parent 8ce59be commit 3af2d18
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
Binary file added 22.6.jar
Binary file not shown.
Binary file added 23.jar
Binary file not shown.
16 changes: 11 additions & 5 deletions core/src/MyStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -1543,12 +1543,18 @@ private void actualMoveToPoint(VehicleGroupInfo myGroup, Point2D point, Move mov
double dx = p.getX() - myAverage.getX();
double dy = p.getY() - myAverage.getY();

List<VehicleWrapper> separatedVehicles = myGroup.countWillBeFurtherThenBefore(new Point2D(dx, dy), p);
if (separatedVehicles.size() > 0) {
log(Utils.LOG_MOVING + " found " + separatedVehicles.size() + " separated vehicles for " + myGroup);
// List<VehicleWrapper> separatedVehicles = myGroup.countWillBeFurtherThenBefore(new Point2D(dx, dy), p);
// boolean shouldScale = separatedVehicles.size() > 0;
boolean shouldScale = Math.sqrt(myGroup.count) * 6 < Math.max(myGroup.pointsInfo.rect.getWidth(), myGroup.pointsInfo.rect.getHeight());

shouldScale = world.getTickIndex() - myGroup.lastShrinkForGatherI > 400 && shouldScale;
if (shouldScale) {
myGroup.lastShrinkForGatherI = world.getTickIndex();
// log(Utils.LOG_MOVING + " found " + separatedVehicles.size() + " separated vehicles for " + myGroup);
log(Utils.LOG_MOVING + " try SCALE ");
move.setAction(ActionType.SCALE);
move.setX(p.getX());
move.setY(p.getY());
move.setX(myAverage.getX());
move.setY(myAverage.getY());
move.setFactor(0.1);
} else {
move.setAction(ActionType.MOVE);
Expand Down
4 changes: 4 additions & 0 deletions core/src/RewindClientWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class RewindClientWrapper implements MyStrategyPainter {
public static final int LAYER_GENERIC = 4;

private static final boolean RESTRICTED_PP_DRAW = true;
private static final boolean DISABLED_PP_DRAW = true;

private MyStrategy mys;
private RewindClient rc;
Expand Down Expand Up @@ -156,6 +157,9 @@ public void onEndTick() {
}

private void drawPP(VehicleGroupInfo myGroup) {
if (DISABLED_PP_DRAW) {
return;
}

PlainArray plainArray = myGroup.potentialMap;

Expand Down
3 changes: 2 additions & 1 deletion core/src/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ public static void main(String[] args) throws IOException {
//runProc(null, true, "java", "-cp", "17.jar", "Runner");
//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.jar", "Runner");
//runProc(null, true, "java", "-cp", "22.3.jar", "Runner");
//runProc(null, true, "java", "-cp", "22.5.jar", "Runner");
runProc(null, true, "java", "-cp", "22.6.jar", "Runner");
}
}).start();
new Runner(new String[]{"127.0.0.1", hasArgs ? "31001" : "31002", "0000000000000000"}).run();
Expand Down
1 change: 1 addition & 0 deletions core/src/VehicleGroupInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class VehicleGroupInfo {
public PointsInfo pointsInfo;
public List<VehicleWrapper> vehicles = new ArrayList<>();
public int lastShrinkI;
public int lastShrinkForGatherI;
public boolean isScaled;
public boolean shouldHeal;
public int groupNumber;
Expand Down

0 comments on commit 3af2d18

Please sign in to comment.