Skip to content

Gradle version #5

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.idea/
*.iml

*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/
# generated and compiled
bin/
gen/

# Package Files #
*.war
*.ear
# Gradle Build
.gradle/
*/build/
build/

Thumbs.db

target/
# setting
.idea/
local.properties
.classpath
.project

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
#Android Studio
*.iml
*.iws
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
#distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
79 changes: 79 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()
maven {
url "https://jitpack.io"
}
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0-beta01'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
maven {
url "https://jitpack.io"
}
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 28

defaultConfig {
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}

buildTypes {
debug {
testCoverageEnabled false
}
}

sourceSets {
main {
java {
// Merge source sets instead of adding rushcore as submodule so that the test coverage report works
srcDirs = ['src/main/java']
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
testImplementation ('junit:junit:4.12') { exclude module: 'hamcrest-core' }

implementation 'com.google.code.gson:gson:2.8.5'
implementation 'org.testng:testng:6.9.6'
implementation 'org.assertj:assertj-core:3.12.2'
}
61 changes: 61 additions & 0 deletions demo-tic-tac-toe/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28

defaultConfig {
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}

buildTypes {
debug {
testCoverageEnabled false
}
}

sourceSets {
main {
java {
// Merge source sets instead of adding rushcore as submodule so that the test coverage report works
srcDirs = ['src/main/java']
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
// implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation ('junit:junit:4.12') { exclude module: 'hamcrest-core' }
modules {
module("org.hamcrest:hamcrest-core") {
replacedBy("junit:junit", "Vous ")
}
}

implementation ('org.slf4j:slf4j-simple:1.8.0-beta4') { exclude module: 'junit' }

implementation 'org.testng:testng:6.9.6'
implementation 'org.assertj:assertj-core:3.12.2'
testImplementation project(path: ':')

// implementation project(path: ':java-reinforcement-learning')
implementation project(path: ':')
}
2 changes: 2 additions & 0 deletions demo-tic-tac-toe/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.github.chen0040.jrl.ttt" />
18 changes: 18 additions & 0 deletions proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/Stuart/Development/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//include ':java-reinforcement-learning'
include ':demo-tic-tac-toe'
project(':demo-tic-tac-toe').projectDir = new File('demo-tic-tac-toe')
2 changes: 2 additions & 0 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.github.chen0040.rl" />
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,64 @@
import java.util.Map;
import java.util.Set;


/**
* Created by xschen on 9/27/2015 0027.
*/
public abstract class AbstractActionSelectionStrategy implements ActionSelectionStrategy {

private String prototype;
protected Map<String, String> attributes = new HashMap<String, String>();

public String getPrototype(){
return prototype;
}
private String prototype;
protected Map<String, String> attributes = new HashMap<>();

public IndexValue selectAction(int stateId, QModel model, Set<Integer> actionsAtState) {
return new IndexValue();
}
public String getPrototype() {
return prototype;
}

public IndexValue selectAction(int stateId, UtilityModel model, Set<Integer> actionsAtState) {
return new IndexValue();
}
public IndexValue selectAction(int stateId, QModel model, Set<Integer> actionsAtState) {
return new IndexValue();
}

public AbstractActionSelectionStrategy(){
prototype = this.getClass().getCanonicalName();
}
public IndexValue selectAction(int stateId, UtilityModel model, Set<Integer> actionsAtState) {
return new IndexValue();
}

public AbstractActionSelectionStrategy() {
prototype = this.getClass().getCanonicalName();
}

public AbstractActionSelectionStrategy(HashMap<String, String> attributes){
this.attributes = attributes;
if(attributes.containsKey("prototype")){
this.prototype = attributes.get("prototype");
}
}
public AbstractActionSelectionStrategy(HashMap<String, String> attributes) {
this.attributes = attributes;
if (attributes.containsKey("prototype")) {
this.prototype = attributes.get("prototype");
}
}

public Map<String, String> getAttributes(){
return attributes;
}
public Map<String, String> getAttributes() {
return attributes;
}

@Override
public boolean equals(Object obj) {
ActionSelectionStrategy rhs = (ActionSelectionStrategy)obj;
if(!prototype.equalsIgnoreCase(rhs.getPrototype())) return false;
for(Map.Entry<String, String> entry : rhs.getAttributes().entrySet()) {
if(!attributes.containsKey(entry.getKey())) {
return false;
}
if(!attributes.get(entry.getKey()).equals(entry.getValue())){
return false;
}
}
for(Map.Entry<String, String> entry : attributes.entrySet()) {
if(!rhs.getAttributes().containsKey(entry.getKey())) {
return false;
}
if(!rhs.getAttributes().get(entry.getKey()).equals(entry.getValue())){
return false;
}
}
return true;
}
@Override
public boolean equals(Object obj) {
ActionSelectionStrategy rhs = (ActionSelectionStrategy) obj;
if (!prototype.equalsIgnoreCase(rhs.getPrototype())) return false;
for (Map.Entry<String, String> entry : rhs.getAttributes().entrySet()) {
if (!attributes.containsKey(entry.getKey())) {
return false;
}
if (!attributes.get(entry.getKey()).equals(entry.getValue())) {
return false;
}
}
for (Map.Entry<String, String> entry : attributes.entrySet()) {
if (!rhs.getAttributes().containsKey(entry.getKey())) {
return false;
}
if (!rhs.getAttributes().get(entry.getKey()).equals(entry.getValue())) {
return false;
}
}
return true;
}

@Override
public abstract Object clone();
@Override
public abstract Object clone();
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
import java.util.Map;
import java.util.Set;


/**
* Created by xschen on 9/27/2015 0027.
*/
public interface ActionSelectionStrategy extends Serializable, Cloneable {
IndexValue selectAction(int stateId, QModel model, Set<Integer> actionsAtState);
IndexValue selectAction(int stateId, UtilityModel model, Set<Integer> actionsAtState);
String getPrototype();
Map<String, String> getAttributes();
IndexValue selectAction(int stateId, QModel model, Set<Integer> actionsAtState);

IndexValue selectAction(int stateId, UtilityModel model, Set<Integer> actionsAtState);

String getPrototype();

Map<String, String> getAttributes();
}
Loading