28 lines
632 B
JavaScript
28 lines
632 B
JavaScript
|
import { defineStore } from "pinia";
|
||
|
|
||
|
export const usePStore = defineStore('Policy Store', {
|
||
|
state: () => {
|
||
|
return {
|
||
|
policy: Array,
|
||
|
weights: [-1, 1, 1],
|
||
|
nr_steps: 0,
|
||
|
}
|
||
|
},
|
||
|
getters: {
|
||
|
getPolicy: (state) => state.policy,
|
||
|
getWeights: (state) => state.weights,
|
||
|
getNrSteps: (state) => state.nr_steps,
|
||
|
},
|
||
|
actions: {
|
||
|
setPolicy(value) {
|
||
|
this.policy = value;
|
||
|
},
|
||
|
setWeights(value) {
|
||
|
this.weights = value;
|
||
|
},
|
||
|
setNrSteps(value) {
|
||
|
this.nr_steps = value;
|
||
|
},
|
||
|
}
|
||
|
})
|