bot/src/pathfinder.cpp
/*
* Score should prioritize safest paths instead of shortest paths
*/
Score should prioritize safest paths instead of shortest paths
Score should prioritize safest paths instead of shortest paths
int a_star_node::calculate_score(piece_data& destination)
{
	score = (piece.x - destination.x) * (piece.x - destination.x);
	score += (piece.y - destination.y) * (piece.y - destination.y) * ((drop_count > 0) * 2 - 1) * 1000;
	if (piece.rotation - destination.rotation == 3)
		score += 1;
	else
		score += (piece.rotation - destination.rotation) * (piece.rotation - destination.rotation);
	score += frame_count * frame_count * frame_count * frame_count;
	score += drop_count * drop_count;
	score += rotate_count * rotate_count;
	score += move_after_drop_count * move_after_drop_count;
	return score;
}
int a_star_node :: calculate_score ( piece_data & destination ) { score = ( piece . x - destination . x ) * ( piece . x - destination . x ) ; score += ( piece . y - destination . y ) * ( piece . y - destination . y ) * ( ( drop_count > 0 ) * 2 - 1 ) * 1000 ; if ( piece . rotation - destination . rotation == 3 ) score += 1 ; else score += ( piece . rotation - destination . rotation ) * ( piece . rotation - destination . rotation ) ; score += frame_count * frame_count * frame_count * frame_count ; score += drop_count * drop_count ; score += rotate_count * rotate_count ; score += move_after_drop_count * move_after_drop_count ; return score ; }
Score should prioritize safest paths instead of shortest paths
Score should prioritize safest paths instead of shortest paths