-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utility AI - framework and Editor [wip] #6323
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6323 +/- ##
============================================
- Coverage 28.53% 28.30% -0.24%
- Complexity 14091 14092 +1
============================================
Files 2792 2844 +52
Lines 273739 275997 +2258
Branches 48494 48679 +185
============================================
+ Hits 78106 78109 +3
- Misses 191650 193906 +2256
+ Partials 3983 3982 -1 ☔ View full report in Codecov by Sentry. |
damageCache.clear(); | ||
} | ||
|
||
public abstract double getBonusFactor(DecisionContext<IN_GAME_OBJECT, TARGETABLE> lastContext); |
Check notice
Code scanning / CodeQL
Useless parameter Note
|
||
public interface Intelligence<IN_GAME_OBJECT, TARGETABLE> { | ||
|
||
void update(Intelligence<IN_GAME_OBJECT, TARGETABLE> intelligence); |
Check notice
Code scanning / CodeQL
Useless parameter Note
void addDecisionScoreEvaluator(Decision<IN_GAME_OBJECT, TARGETABLE> scoreEvaluator); | ||
List<Decision<IN_GAME_OBJECT, TARGETABLE>> getDecisions(); | ||
DecisionMaker<IN_GAME_OBJECT, TARGETABLE> getDecisionMaker(); | ||
double getBonusFactor(Decision<IN_GAME_OBJECT, TARGETABLE> scoreEvaluator); |
Check notice
Code scanning / CodeQL
Useless parameter Note
megamek/src/megamek/client/bot/duchess/ai/utility/tw/TWUtilityAIRepository.java
Fixed
Show fixed
Hide fixed
megamek/src/megamek/client/bot/duchess/ai/utility/tw/TWUtilityAIRepository.java
Fixed
Show fixed
Hide fixed
82be31d
to
572a2a2
Compare
megamek/src/megamek/client/bot/duchess/ai/utility/tw/TWUtilityAIRepository.java
Fixed
Show fixed
Hide fixed
2f32e50
to
448b792
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
var splitPosition = hex.length() / 2; | ||
|
||
int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1; | ||
int y = Integer.parseInt(hex.substring(splitPosition)) - 1; |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
|
||
int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1; | ||
int y = Integer.parseInt(hex.substring(splitPosition)) - 1; | ||
|
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
return; | ||
} | ||
int unitID = Integer.parseInt(unitIdString); | ||
|
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
var splitPosition = hex.length() / 2; | ||
|
||
int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1; | ||
int y = Integer.parseInt(hex.substring(splitPosition)) - 1; |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
|
||
int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1; | ||
int y = Integer.parseInt(hex.substring(splitPosition)) - 1; | ||
|
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
return intelligence; | ||
} | ||
|
||
public TWWorld getWorld() { |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
Agent<Entity,Entity>.getWorld
persistDataToUserData(); | ||
deleteUserTempFiles(); | ||
} catch (IOException e) { | ||
logger.error(e, "Could not load data from file: {}", zipInput); |
Check warning
Code scanning / CodeQL
Unused format argument Warning
megamek/src/megamek/client/bot/queen/ai/utility/tw/TWUtilityAIRepository.java
Fixed
Show fixed
Hide fixed
return 0; | ||
} | ||
|
||
public TreeSet<RankedPath> rankPaths(List<MovePath> movePaths, Game game, int maxRange, |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PathRanker.rankPaths
megamek/src/megamek/client/ui/swing/ai/editor/ConsiderationParametersTable.java
Fixed
Show fixed
Hide fixed
return this; | ||
} | ||
|
||
public DebugReporter append(Object s) { |
Check notice
Code scanning / CodeQL
Confusing overloading of methods Note
append
return finalScore; | ||
} | ||
|
||
public List<Consideration<IN_GAME_OBJECT, TARGETABLE>> getConsiderations() { |
Check notice
Code scanning / CodeQL
Exposing internal representation Note
after this call to getConsiderations
return 0; | ||
} | ||
|
||
public double getBonusFactor(RankedPath rankedPath) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
return id; | ||
} | ||
|
||
public List<Decision<A, B>> getDecisions() { |
Check notice
Code scanning / CodeQL
Exposing internal representation Note
Development of a Utility AI framework to be implemented with a bot (preferably on top of princess, preferably creating a new way to have her make decisions).
This PR currently only implements a few considerations and an AI Editor, this PR intends to allow people to test and evaluate the usability of the AI Editor.
TODO: More information on the Utility AI, how it works, how it integrates with Princessm etc.