Skip to content

Commit 4d8765d

Browse files
committed
fix: disable findBetterTradeLocation for now, it's too slow
1 parent d79657c commit 4d8765d

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

TODO.md

+11
Original file line numberDiff line numberDiff line change
@@ -1205,3 +1205,14 @@ https://github.com/SpaceTradersAPI/api-docs/wiki/Travel-Fuel-and-Time
12051205
### Build a profit/loss statement.
12061206

12071207
### Build a cash flow statement.
1208+
1209+
### This seems wrong? Is it considering jumping?
1210+
1211+
Found 3 deals for ESEIDEL-49 from AQ24-I53
1212+
🛸#49 Found deal: LIQUID_HYDROGEN AQ24-C40 3c -> AQ24-G48 32c +3,648c (414%) 9m 6c/s 882c
1213+
🛸#49 ⛽ 4 FUEL +3% +2c per 4 x 74c = -296c -> 🏦 1,667c
1214+
🛸#49 Market at AQ24-I53 doesn't buy FABRICS
1215+
🛸#49 Cargo hold not empty, finding market to sell FABRICS.
1216+
🛸#49 Selecting AQ24-K85 earns 28,650c extra (including 14,147c for fuel) over 6s (4775.0/s)
1217+
🛸#49 Beginning route to AQ24-K85 (5m)
1218+
🛸#49 🛫 to AQ24-K85 PLANET (5m) spent 366 fuel

packages/cli/lib/central_command.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ class CentralCommand {
106106

107107
/// Returns true if we should chart asteroids in the given [systemSymbol].
108108
bool chartAsteroidsInSystem(SystemSymbol systemSymbol) {
109-
return _chartAsteroidsInSystem[systemSymbol] ?? false;
109+
return _chartAsteroidsInSystem[systemSymbol] ??
110+
config.chartAsteroidsByDefault;
110111
}
111112

112113
/// Sets whether we should chart asteroids in the given [systemSymbol].
@@ -165,7 +166,7 @@ class CentralCommand {
165166
final miningBehaviors = {
166167
Behavior.miner,
167168
Behavior.minerHauler,
168-
// Behavior.siphoner,
169+
Behavior.siphoner,
169170
Behavior.surveyor,
170171
};
171172
if (!config.enableMining && miningBehaviors.contains(behavior)) {

packages/cli/lib/config.dart

+9-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ class Config {
3333
/// planning (assigning ships to squads, planning mounts, etc.)
3434
final int centralPlanningInterval = 20;
3535

36+
/// Used to slow down charters and have them spend less money on jumps.
37+
bool chartAsteroidsByDefault = false;
38+
39+
/// findBetterTradeLocation is too slow when we have lots of systems
40+
bool disableFindBetterTradeLocation = true;
41+
3642
/// The number of requests per second allowed by the api.
3743
/// Version 2.1 allows:
3844
/// - 2 requests per second
@@ -58,11 +64,13 @@ class Config {
5864
ShipType.MINING_DRONE,
5965
ShipType.SURVEYOR,
6066
for (int i = 0; i < 13; i++) ShipType.LIGHT_HAULER,
67+
// Only buy after gate opens.
6168
for (int i = 0; i < 20; i++) ShipType.PROBE,
6269
for (int i = 0; i < 10; i++) ShipType.REFINING_FREIGHTER,
70+
// Only buy with 3m in cash?
6371
for (int i = 0; i < 20; i++) ShipType.PROBE,
72+
// Only buy with 3m in cash?
6473
for (int i = 0; i < 20; i++) ShipType.EXPLORER,
65-
// ShipType.EXPLORER,
6674
];
6775

6876
// TODO(eseidel): Should be some dynamic min count of light-haulers before we

packages/cli/lib/plan/market_scores.dart

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:cli/caches.dart';
2+
import 'package:cli/config.dart';
23
import 'package:cli/logger.dart';
34
import 'package:cli/logic/printing.dart';
45
import 'package:cli/plan/trading.dart';
@@ -18,6 +19,9 @@ WaypointSymbol? findBetterTradeLocation(
1819
required Set<SystemSymbol> avoidSystems,
1920
required int profitPerSecondThreshold,
2021
}) {
22+
if (config.disableFindBetterTradeLocation) {
23+
return null;
24+
}
2125
final search = _MarketSearch.start(
2226
marketPrices,
2327
systemsCache,

0 commit comments

Comments
 (0)