Skip to content

Commit

Permalink
Merge pull request #6 from lugobots/organizing-npm-pakg
Browse files Browse the repository at this point in the history
Organizing npm pakg
  • Loading branch information
rubens21 authored Sep 3, 2022
2 parents 55902df + 7b6dc62 commit dcadc6b
Show file tree
Hide file tree
Showing 40 changed files with 18 additions and 106 deletions.
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
./example
./node_modules
./src
./test
.gitignore
commonjs.package.json
Readme.md
tsconfig.json
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ See example in [Deep learning example project](example/deeplearning)

#### 1. Create a Trainable bot

Create a class that extends the [Trainable bot](deep_learning/stubs.js#L28). Your trainable bot will be responsible for:
Create a class that extends the [Trainable bot](src/deep_learning/stubs.js#L28). Your trainable bot will be responsible for:

* processing the actions generated by your training model (see method `play(orderSet, snapshot, action)`)
* creating new scenarios for each training game
Expand Down Expand Up @@ -132,7 +132,7 @@ class TrainableBot {

If you are familiar with deep learn and **Tensorflow**, you know what a training function does. The only particularity
for Lugo Deep learning environment is that our training function will receive as a parameter an instance of
a [Lugo4Node Coach](deep_learning/stubs.js#L1).
a [Lugo4Node Coach](src/deep_learning/stubs.js#L1).

Your training function will use the coach instance to set random states, get the new state tensor, and to update the
game state based in an action defined by your training model.
Expand Down
1 change: 0 additions & 1 deletion dist/test/mapper.d.ts

This file was deleted.

92 changes: 0 additions & 92 deletions dist/test/mapper.js

This file was deleted.

2 changes: 1 addition & 1 deletion example/deeplearning/my_bot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const {homeGoal, FIELD, directions, vectors, GameSnapshotReader, deep_learning, Mapper} = require("lugo4node");
const tf = require("@tensorflow/tfjs-node");
const {delay} = require("../../deep_learning/coach");
const {delay} = require("../../src/deep_learning/coach");


const ALL_FORWARD = 0;
Expand Down
6 changes: 1 addition & 5 deletions example/simple/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Lugo4Node is a NodeJS implementation of a client player for [Lugo](https://lugobots.dev/) game.",
"main": "dist/index.js",
"scripts": {
"tsc": "rm -rf dist/* && mkdir -p dist/pb && tsc && cp pb/* dist/pb/ && cp commonjs.package.json dist/package.json",
"tsc": "rm -rf dist/* && mkdir -p dist/pb && tsc && cp src/pb/* dist/pb/ && cp commonjs.package.json dist/package.json",
"tsconly": "tsc"
},
"type": "module",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/mapper.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const assert = require('assert');
const mapper = require('../mapper')
const field = require('../specs')
const {FIELD} = require("../index");
const mapper = require('../src/mapper')
const field = require('../src/specs')
const {FIELD} = require("../src");

describe('Region', () => {
it('should identify an equal region', () => {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"node_modules",
"example",
"dist",
"pb"
"test",
"src/pb"
],
}

0 comments on commit dcadc6b

Please sign in to comment.