forked from martinchapman/hands
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Behaviour and properties of traversers via plugin
- Add additional seekers
- Loading branch information
1 parent
94b035d
commit 9abfcaa
Showing
10 changed files
with
142 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/org/kclhi/hands/seeker/singleshot/random/RandomWalkHighGasVariableGas.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.kclhi.hands.seeker.singleshot.random; | ||
|
||
import org.json.JSONObject; | ||
import org.kclhi.hands.Gas; | ||
import org.kclhi.hands.Gas.HighGasGraphTraverser; | ||
import org.kclhi.hands.graph.GraphController; | ||
import org.kclhi.hands.graph.StringEdge; | ||
import org.kclhi.hands.graph.StringVertex; | ||
import org.kclhi.hands.utility.Utils; | ||
|
||
/** | ||
* | ||
* | ||
* @author Martin | ||
* | ||
*/ | ||
public class RandomWalkHighGasVariableGas extends RandomWalk implements HighGasGraphTraverser { | ||
|
||
public RandomWalkHighGasVariableGas(GraphController<StringVertex, StringEdge> graphController) { | ||
super(graphController); | ||
} | ||
|
||
@Override | ||
public boolean useGas() { | ||
JSONObject plugin = Utils.getPlugin(); | ||
double usageUpper = plugin!=null ? plugin.getJSONObject("seekers").getJSONObject("variablesByType").getJSONObject("behaviour").getJSONObject("Gas").getDouble("leverageProbability") : Gas.DEFAULT_USAGE_UPPER; | ||
return Math.random() < usageUpper; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/org/kclhi/hands/seeker/singleshot/random/RandomWalkMediumGasVariableGas.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.kclhi.hands.seeker.singleshot.random; | ||
|
||
import org.json.JSONObject; | ||
import org.kclhi.hands.Gas; | ||
import org.kclhi.hands.Gas.MediumGasGraphTraverser; | ||
import org.kclhi.hands.graph.GraphController; | ||
import org.kclhi.hands.graph.StringEdge; | ||
import org.kclhi.hands.graph.StringVertex; | ||
import org.kclhi.hands.utility.Utils; | ||
|
||
/** | ||
* | ||
* | ||
* @author Martin | ||
* | ||
*/ | ||
public class RandomWalkMediumGasVariableGas extends RandomWalk implements MediumGasGraphTraverser { | ||
|
||
public RandomWalkMediumGasVariableGas(GraphController<StringVertex, StringEdge> graphController) { | ||
super(graphController); | ||
} | ||
|
||
@Override | ||
public boolean useGas() { | ||
JSONObject plugin = Utils.getPlugin(); | ||
double usageUpper = plugin!=null ? plugin.getJSONObject("seekers").getJSONObject("variablesByType").getJSONObject("behaviour").getJSONObject("Gas").getDouble("leverageProbability") : Gas.DEFAULT_USAGE_UPPER; | ||
return Math.random() < usageUpper; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters