Permalink
Browse files

Adding changes to LevelScene

  • Loading branch information...
1 parent 2324cc1 commit fefbf5b7cd627cc453b3310bcfcde4e612dcb14f @deanputney deanputney committed Aug 9, 2009
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -16,7 +16,7 @@
private double[] outputs;
private double[] inputs;
//private double[] targetOutputs;
- public double mutationMagnitude = 0.1;
+ public double mutationMagnitude = 0.5;
public static double mean = 0.0f; // initialization mean
@@ -0,0 +1,37 @@
+package ch.idsia.ai.agents.ai;
+
+import ch.idsia.ai.agents.Agent;
+import ch.idsia.ai.agents.RegisterableAgent;
+import ch.idsia.mario.engine.sprites.Mario;
+import ch.idsia.mario.environments.Environment;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Sergey Karakovskiy
+ * Date: Apr 25, 2009
+ * Time: 12:27:07 AM
+ * Package: ch.idsia.ai.agents.ai;
+ */
+
+public class AlteredForwardJumpingAgent extends RegisterableAgent implements Agent
+{
+ public AlteredForwardJumpingAgent()
+ {
+ super("AlteredForwardJumpingAgent");
+ reset();
+ }
+
+ public void reset()
+ {
+ action = new boolean[Environment.numberOfButtons];
+ action[Mario.KEY_RIGHT] = true;
+ action[Mario.KEY_SPEED] = true;
+ }
+
+ public boolean[] getAction(Environment observation)
+ {
+
+ action[Mario.KEY_SPEED] = action[Mario.KEY_JUMP] = observation.mayMarioJump() || !observation.isMarioOnGround();
+ return action;
+ }
+}
@@ -98,7 +98,7 @@ private byte ZLevelMapElementGeneralization(byte el, int ZLevel)
case(-108):
case(-107):
case(-106):
- case(14): // Particle
+ //case(14): // Particle - what is this *supposed to be? 14 is a cannon
case(15): // Sparcle, irrelevant
return 0;
case(-128):
@@ -134,7 +134,9 @@ private byte ZLevelMapElementGeneralization(byte el, int ZLevel)
case(-82):
case(-81):
case(4):
+ case(14): // canon top
case(30): // canon
+ case(46): // canon bottom
return -10; // border, cannot pass through, can stand on
case(9):
return -12; // hard formation border. Pay attention!
@@ -4,19 +4,16 @@
package ch.idsia.scenarios;
-<<<<<<< HEAD:src/ch/idsia/scenarios/Play.java
//If you're using Eclipse, you should expand this import statement.
import ch.idsia.ai.agents.Agent;
import ch.idsia.ai.agents.RegisterableAgent;
import ch.idsia.ai.agents.ai.HardcodedAgent; // This line imports your interface agent.
-=======
-import com.reddit.programming.mario.HardcodedAgent;
+//import com.reddit.programming.mario.HardcodedAgent;
import ch.idsia.ai.agents.Agent;
import ch.idsia.ai.agents.RegisterableAgent;
import ch.idsia.ai.agents.ai.*;
import ch.idsia.ai.agents.human.HumanKeyboardAgent;
->>>>>>> 44d9250a7c93e865e1e4b9ea487dd0aa6d1bf054:src/ch/idsia/scenarios/Play.java
import ch.idsia.ai.tasks.ProgressTask;
import ch.idsia.ai.tasks.Task;
import ch.idsia.tools.CmdLineOptions;
@@ -32,11 +29,7 @@
public class Play {
public static void main(String[] args) {
-<<<<<<< HEAD:src/ch/idsia/scenarios/Play.java
Agent controller = new HardcodedAgent(); // This line uses the agent you imported above.
-=======
- Agent controller = new HardcodedAgent();
->>>>>>> 44d9250a7c93e865e1e4b9ea487dd0aa6d1bf054:src/ch/idsia/scenarios/Play.java
if (args.length > 0) {
controller = RegisterableAgent.load (args[0]);
RegisterableAgent.registerAgent (controller);

0 comments on commit fefbf5b

Please sign in to comment.