Update DebugMode
Click '0' to skip level (Finally done this feature)
This commit is contained in:
parent
2bc77cfe4f
commit
b5ca526f8b
32
.idea/workspace.xml
generated
32
.idea/workspace.xml
generated
@ -5,14 +5,12 @@
|
|||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface.jar" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface.jar" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface.jar" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface.jar" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface.jar.js" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface.jar.js" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface.jar.js" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface.jar.js" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/reps/f_l_sav.rep" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/reps/f_l_sav.rep" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/agents/HumanAgent.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/agents/HumanAgent.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/Play.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/Play.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/agents/ReplayAgent.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/agents/ReplayAgent.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/agents/ReplayAgent.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/agents/ReplayAgent.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioForwardModel.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioForwardModel.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioGame.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioGame.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioGame.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioGame.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/data/annotation.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data/annotation.csv" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/data/questionare.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data/questionare.csv" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/data/questionare.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data/questionare.csv" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/templates/GameAnnotation.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/GameAnnotation.html" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/templates/GameWelcome.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/GameWelcome.html" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/templates/GameAnnotation2.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/GameAnnotation2.html" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@ -48,17 +46,17 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
"WebServerToolWindowFactoryState": "false",
|
"WebServerToolWindowFactoryState": "false",
|
||||||
"last_opened_file_path": "C:/Users/duaho/Documents/Python Projects/evogym",
|
"last_opened_file_path": "C:/Users/duaho/Documents/Python Projects/evogym",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"settings.editor.selected.configurable": "application.passwordSafe"
|
"settings.editor.selected.configurable": "application.passwordSafe"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
<recent name="C:\Users\duaho\Projects\website materials\MarioWeb\templates" />
|
<recent name="C:\Users\duaho\Projects\website materials\MarioWeb\templates" />
|
||||||
@ -213,6 +211,8 @@
|
|||||||
<workItem from="1675757773553" duration="7165000" />
|
<workItem from="1675757773553" duration="7165000" />
|
||||||
<workItem from="1675829047440" duration="2956000" />
|
<workItem from="1675829047440" duration="2956000" />
|
||||||
<workItem from="1676377283551" duration="34000" />
|
<workItem from="1676377283551" duration="34000" />
|
||||||
|
<workItem from="1676991343098" duration="1013000" />
|
||||||
|
<workItem from="1677221941122" duration="1304000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
@ -233,7 +233,7 @@
|
|||||||
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
||||||
<SUITE FILE_PATH="coverage/MarioWeb$MarioWeb.coverage" NAME="MarioWeb Coverage Results" MODIFIED="1669305478201" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
<SUITE FILE_PATH="coverage/MarioWeb$MarioWeb.coverage" NAME="MarioWeb Coverage Results" MODIFIED="1669305478201" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
||||||
<SUITE FILE_PATH="coverage/MarioWeb$test.coverage" NAME="test Coverage Results" MODIFIED="1668079935841" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
<SUITE FILE_PATH="coverage/MarioWeb$test.coverage" NAME="test Coverage Results" MODIFIED="1668079935841" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||||
<SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py_.coverage" NAME="Flask (main.py) Coverage Results" MODIFIED="1675839259180" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
<SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py_.coverage" NAME="Flask (main.py) Coverage Results" MODIFIED="1677223621991" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||||
<SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py___1_.coverage" NAME="Flask (main.py) (1) Coverage Results" MODIFIED="1668079945407" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
<SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py___1_.coverage" NAME="Flask (main.py) (1) Coverage Results" MODIFIED="1668079945407" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -11,6 +11,7 @@ import engine.helper.MarioActions;
|
|||||||
public class HumanAgent extends KeyAdapter implements MarioAgent {
|
public class HumanAgent extends KeyAdapter implements MarioAgent {
|
||||||
private boolean[] actions = null;
|
private boolean[] actions = null;
|
||||||
private boolean oldControl = true;
|
private boolean oldControl = true;
|
||||||
|
private boolean isPressed = false;
|
||||||
|
|
||||||
public HumanAgent(boolean oldControl){
|
public HumanAgent(boolean oldControl){
|
||||||
this.oldControl = oldControl;
|
this.oldControl = oldControl;
|
||||||
@ -18,11 +19,18 @@ public class HumanAgent extends KeyAdapter implements MarioAgent {
|
|||||||
@Override
|
@Override
|
||||||
public void initialize(MarioForwardModel model, MarioTimer timer) {
|
public void initialize(MarioForwardModel model, MarioTimer timer) {
|
||||||
actions = new boolean[MarioActions.numberOfActions()];
|
actions = new boolean[MarioActions.numberOfActions()];
|
||||||
|
isPressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean[] getActions(MarioForwardModel model, MarioTimer timer) {
|
public boolean[] getActions(MarioForwardModel model, MarioTimer timer) {
|
||||||
return actions.clone();
|
if(!isPressed){
|
||||||
|
return actions.clone();
|
||||||
|
}else{
|
||||||
|
System.out.println("return true");
|
||||||
|
return new boolean[]{true, false, true, true, true};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -44,6 +52,14 @@ public class HumanAgent extends KeyAdapter implements MarioAgent {
|
|||||||
if (this.actions == null) {
|
if (this.actions == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(keyCode==KeyEvent.VK_0){
|
||||||
|
if(isPressed){
|
||||||
|
this.isPressed = true;
|
||||||
|
System.out.println("Pressed");
|
||||||
|
}else{
|
||||||
|
this.isPressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(oldControl){
|
if(oldControl){
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
case KeyEvent.VK_LEFT:
|
case KeyEvent.VK_LEFT:
|
||||||
|
@ -37,7 +37,7 @@ public class ReplayAgent extends KeyAdapter implements MarioAgent {
|
|||||||
return this.actions[p++];
|
return this.actions[p++];
|
||||||
}else{
|
}else{
|
||||||
System.out.println("return true");
|
System.out.println("return true");
|
||||||
return new boolean[]{true, true, true, true, true};
|
return new boolean[]{true, true, false, true, true};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,8 @@ public class MarioGame extends KeyAdapter{
|
|||||||
|
|
||||||
ArrayList<MarioEvent> gameEvents = new ArrayList<>();
|
ArrayList<MarioEvent> gameEvents = new ArrayList<>();
|
||||||
ArrayList<MarioAgentEvent> agentEvents = new ArrayList<>();
|
ArrayList<MarioAgentEvent> agentEvents = new ArrayList<>();
|
||||||
boolean midBreak = false;
|
boolean replayBreak = false;
|
||||||
|
boolean cheatBreak = false;
|
||||||
int segNum = 0;
|
int segNum = 0;
|
||||||
while (this.world.gameStatus == GameStatus.RUNNING) {
|
while (this.world.gameStatus == GameStatus.RUNNING) {
|
||||||
if (!this.pause) {
|
if (!this.pause) {
|
||||||
@ -191,11 +192,16 @@ public class MarioGame extends KeyAdapter{
|
|||||||
+ Math.abs(agentTimer.getRemainingTime()) + " msec.");
|
+ Math.abs(agentTimer.getRemainingTime()) + " msec.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// mid break
|
// Mid Break & Cheat Mode
|
||||||
if(actions[1]&&actions[2]){
|
if(actions[0]&&actions[1]){
|
||||||
this.world.gameStatus = GameStatus.LOSE;
|
this.world.lose();
|
||||||
midBreak = true;
|
replayBreak = true;
|
||||||
break;
|
//break;
|
||||||
|
}
|
||||||
|
if(actions[0]&&actions[2]){
|
||||||
|
this.world.lose();
|
||||||
|
cheatBreak = true;
|
||||||
|
//break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// update world
|
// update world
|
||||||
@ -221,7 +227,7 @@ public class MarioGame extends KeyAdapter{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
MarioResult res = new MarioResult(this.world, gameEvents, agentEvents);
|
MarioResult res = new MarioResult(this.world, gameEvents, agentEvents);
|
||||||
if (!resultPath.isEmpty()&&!midBreak) {
|
if (!resultPath.isEmpty()&&!replayBreak) {
|
||||||
Replay.saveReplay(resultPath, res.getAgentEvents());
|
Replay.saveReplay(resultPath, res.getAgentEvents());
|
||||||
}
|
}
|
||||||
return new MarioResult(this.world, gameEvents, agentEvents);
|
return new MarioResult(this.world, gameEvents, agentEvents);
|
||||||
|
@ -23,3 +23,6 @@ IP,A-ID,B-ID,Anno,
|
|||||||
10.27.169.251,160,121,N,
|
10.27.169.251,160,121,N,
|
||||||
10.27.169.251,69,124,N,
|
10.27.169.251,69,124,N,
|
||||||
10.27.169.251,165,79,A,
|
10.27.169.251,165,79,A,
|
||||||
|
127.0.0.1,160,84,N,
|
||||||
|
127.0.0.1,75,17,N,
|
||||||
|
127.0.0.1,69,73,N,
|
||||||
|
|
@ -171,3 +171,8 @@ IP,Style,Frequency,Age,Gender
|
|||||||
127.0.0.1,A,A,A,A,A,A,,
|
127.0.0.1,A,A,A,A,A,A,,
|
||||||
127.0.0.1,A,A,A,A,A,A,,
|
127.0.0.1,A,A,A,A,A,A,,
|
||||||
127.0.0.1,A,A,A,A,A,A,,
|
127.0.0.1,A,A,A,A,A,A,,
|
||||||
|
127.0.0.1,A,A,D,A,F,A,,
|
||||||
|
127.0.0.1,A,A,A,A,A,A,,
|
||||||
|
127.0.0.1,A,A,D,A,D,A,,
|
||||||
|
127.0.0.1,A,A,D,A,A,A,,
|
||||||
|
127.0.0.1,A,A,A,E,A,C,,
|
||||||
|
|
@ -215,14 +215,15 @@
|
|||||||
<br>
|
<br>
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
|
|
||||||
<div class="col-md-5">
|
<div class="col-md-5"style="
|
||||||
|
width: fit-content;
|
||||||
<div >
|
display: flex;
|
||||||
<img src="../img/welcome.png" height="100%">
|
justify-content: center;
|
||||||
</div>
|
min-width: fit-content;
|
||||||
|
">
|
||||||
|
<img src="../img/welcome.png" >
|
||||||
</div>
|
</div>
|
||||||
<dic class="col-md-2"></dic>
|
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<br><br>
|
<br><br>
|
||||||
<h4>Purpose of the Experiment</h4>
|
<h4>Purpose of the Experiment</h4>
|
||||||
|
Loading…
Reference in New Issue
Block a user