Last change
on this file since 126 was 126, checked in by Aron Hammond, 6 years ago |
Added function to calculate opposition to MultiLateralAnalysis.java
Moved code to add RLBOA listeners to RLBOAUtils is misc package
Added input for strategyParameters to SessionPanel (gui)
!! close SessionInfo after tournament; this caused /tmp/ to fill up with GeniusData files
Our own package:
- Added opponents and strategies that are mentioned in the report
- Change class hierarchy, agents can now extend from RLBOAagentBilateral to inherit RL functionality.
- States extend from AbstractState
|
File size:
421 bytes
|
Line | |
---|
1 | package agents.Jama.util;
|
---|
2 |
|
---|
3 | public class Maths {
|
---|
4 |
|
---|
5 | /** sqrt(a^2 + b^2) without under/overflow. **/
|
---|
6 |
|
---|
7 | public static double hypot(double a, double b) {
|
---|
8 | double r;
|
---|
9 | if (Math.abs(a) > Math.abs(b)) {
|
---|
10 | r = b/a;
|
---|
11 | r = Math.abs(a)*Math.sqrt(1+r*r);
|
---|
12 | } else if (b != 0) {
|
---|
13 | r = a/b;
|
---|
14 | r = Math.abs(b)*Math.sqrt(1+r*r);
|
---|
15 | } else {
|
---|
16 | r = 0.0;
|
---|
17 | }
|
---|
18 | return r;
|
---|
19 | }
|
---|
20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.