You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/bwapi/BWClientConfiguration.java
+10-8Lines changed: 10 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,14 @@ public class BWClientConfiguration {
25
25
*/
26
26
publicbooleanunlimitedFrameZero = true;
27
27
28
+
/**
29
+
* The maximum amount of time the bot is supposed to spend on a single frame.
30
+
* In asynchronous mode, JBWAPI will attempt to let the bot use up to this much time to process all frames before returning control to BWAPI.
31
+
* In synchronous mode, JBWAPI is not empowered to prevent the bot to exceed this amount, but will record overruns in performance metrics.
32
+
* Real-time human play typically uses the "fastest" game speed, which has 42.86ms (42,860ns) between frames.
33
+
*/
34
+
publicintmaxFrameDurationMs = 40;
35
+
28
36
/**
29
37
* Runs the bot in asynchronous mode. Asynchronous mode helps attempt to ensure that the bot adheres to real-time performance constraints.
30
38
*
@@ -38,12 +46,6 @@ public class BWClientConfiguration {
38
46
*/
39
47
publicbooleanasync = false;
40
48
41
-
/**
42
-
* If JBWAPI detects that this much time (in nanoseconds) has passed since a bot's event handlers began, returns control back to BWAPI.
43
-
* Real-time human play typically uses the "fastest" game speed, which has 42.86ms (42,860ns) between frames.
44
-
*/
45
-
publicintasyncFrameDurationMs = 40;
46
-
47
49
/**
48
50
* The maximum number of frames to buffer while waiting on a bot.
49
51
* Each frame buffered adds about 33 megabytes to JBWAPI's memory footprint.
@@ -59,8 +61,8 @@ public class BWClientConfiguration {
59
61
* Checks that the configuration is in a valid state. Throws an IllegalArgumentException if it isn't.
60
62
*/
61
63
publicvoidvalidate() {
62
-
if (async && asyncFrameDurationMs < 0) {
63
-
thrownewIllegalArgumentException("asyncFrameDurationMs needs to be a non-negative number (it's how long JBWAPI waits for a bot response before returning control to BWAPI).");
64
+
if (async && maxFrameDurationMs < 0) {
65
+
thrownewIllegalArgumentException("maxFrameDurationMs needs to be a non-negative number (it's how long JBWAPI waits for a bot response before returning control to BWAPI).");
64
66
}
65
67
if (async && asyncFrameBufferSize < 1) {
66
68
thrownewIllegalArgumentException("asyncFrameBufferSize needs to be a positive number (There needs to be at least one frame buffer).");
0 commit comments