Skip to content

Commit

Permalink
improve explore
Browse files Browse the repository at this point in the history
  • Loading branch information
mvpatel2000 committed Jan 28, 2021
1 parent f6fc807 commit d41fe08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/jefferson/EnlightmentCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public EnlightmentCenter(RobotController rc) throws GameActionException {
public void run() throws GameActionException {
super.run();

if (currentRound == 800) {
if (currentRound == 600) {
rc.resign(); // TODO: remove; just for debugging
}

Expand Down
10 changes: 6 additions & 4 deletions src/jefferson/Muckraker.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ void setInitialMomentum() {
void setMoveWeights() {
momentumWeight *= 0.97;
destWeight = 1;
passabilityWeight = 1;
passabilityWeight = currentRound < 200 && exploreMode ? 10 : 1;
// System.out.println("PWeight: " + passabilityWeight);
spreadWeight = Math.pow(rc.getRoundNum() + (exploreMode ? 500 : 100), 0.4);
}

Expand Down Expand Up @@ -252,6 +253,7 @@ void muckrakerMove() throws GameActionException {

// passability component
scores[i] += passabilityWeight / rc.sensePassability(targetLoc);
// System.out.println("Dir: " + di + " " + (passabilityWeight / rc.sensePassability(targetLoc)) + " " + scores[i]);
}

// spread component
Expand Down Expand Up @@ -324,8 +326,8 @@ void muckrackerRerouteDestination() throws GameActionException {
int deltaY = destination.y - previousDestination.y;
double mult = scaleVector(deltaX, deltaY, 48);

System.out.println("Prev Dest: " + previousDestination);
System.out.println("Curr Dest: " + destination);
// System.out.println("Prev Dest: " + previousDestination);
// System.out.println("Curr Dest: " + destination);

deltaX = (int)((double)(deltaX) * mult);
deltaY = (int)((double)(deltaY) * mult);
Expand Down Expand Up @@ -357,7 +359,7 @@ void muckrackerRerouteDestination() throws GameActionException {
//System.out.println("Scale: " + i);
//System.out.println("Best 45 shot is: " + destination);
//destination = myLocation.translate((int)(i*bestDeltaX), (int)(i*bestDeltaY));
System.out.println("Best dest is: " + destination);
// System.out.println("Best dest is: " + destination);

exploreMode = true;
previousDestination = currDestination;
Expand Down

0 comments on commit d41fe08

Please sign in to comment.