Comparing version 0.19.0 to 0.19.2
@@ -6,3 +6,4 @@ - [x] specifying the initial edges as 1-dir node edges, | ||
- [ ] being the most probable edge, | ||
- [ ] random walks | ||
- [x] following one edge probabilistically, | ||
- [x] random walks | ||
- [x] which states are "complete" (that is, that an input sequence can be considered satisfactorily terminal), | ||
@@ -9,0 +10,0 @@ - [x] whether a machine is |
{ | ||
"name": "jssm", | ||
"version": "0.19.0", | ||
"version": "0.19.2", | ||
"description": "A Javascript state machine with a simple API. Well tested, and typed with Flowtype. MIT License.", | ||
@@ -13,3 +13,3 @@ "main": "dist/jssm.es5.browserified.js", | ||
"rename": "node -e \"require('fs').renameSync('./build/jssm.js', './build/jssm.es5.js');\"", | ||
"pack": "browserify -r ./build/jssm.es5.js:jssm -o build/jssm.es5.amd.js", | ||
"pack": "browserify -r ./build/jssm.es5.js:jssm -o build/jssm.es5.cjs.js", | ||
"make": "npm run clean && npm run babel && npm run rename && npm run setver && npm run pack", | ||
@@ -16,0 +16,0 @@ "flow": "flow", |
@@ -86,3 +86,3 @@ | ||
probability? : number, // for stoch modelling, would like to constrain to [0..1], dunno how | ||
usual? : '' // most common exit, for graphing; likelihood overrides | ||
usual? : string // most common exit, for graphing; likelihood overrides | ||
}; | ||
@@ -89,0 +89,0 @@ |
@@ -272,4 +272,8 @@ | ||
probabilistic_histo_walk(n : number) : Map<any, number> { | ||
return this.histograph(this.probabilistic_walk(n)); | ||
} | ||
rand_select(options : Array<any>, probability_property : string = 'probability') { | ||
@@ -294,4 +298,4 @@ | ||
histograph(a : Array<mixed>) { | ||
return a.sort().reduce( (a,v) => ( a.set(v, (a.has(v)? a.get(v)+1 : 1)) , a), new Map() ); | ||
histograph(a : Array<any>) { | ||
return a.sort().reduce( (m,v) => ( m.set(v, (m.has(v)? m.get(v)+1 : 1)) , m), new Map() ); | ||
} | ||
@@ -303,3 +307,3 @@ | ||
histo(n : number, options : Array<mixed>, probability_property : string, extract : string) { | ||
histo_key(n : number, options : Array<mixed>, probability_property : string, extract : string) { | ||
return this.histograph(this.sample_select(n, options, probability_property).map( (s:any) => s[extract])); | ||
@@ -429,7 +433,3 @@ } | ||
const action_base = this._actions.get(action); | ||
if (action_base) { | ||
return action_base.get(this.state()); | ||
} else { | ||
return undefined; | ||
} | ||
return action_base? action_base.get(this.state()) : undefined; | ||
} | ||
@@ -436,0 +436,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47833
693