FanucWeb/ActiveBOWeb/src/store/PolicyStore.js

34 lines
857 B
JavaScript
Raw Normal View History

2023-02-17 12:29:49 +00:00
import { defineStore } from "pinia";
export const usePStore = defineStore('Policy Store', {
state: () => {
return {
policy: Array,
2023-02-27 15:49:09 +00:00
nr_weights: 5,
weights: [0, 0, 0, 0, 0],
max_steps: 0,
2023-02-17 12:29:49 +00:00
}
},
getters: {
getPolicy: (state) => state.policy,
2023-02-27 15:49:09 +00:00
getNrWeights: (state) => state.nr_weights,
2023-02-17 12:29:49 +00:00
getWeights: (state) => state.weights,
2023-02-27 15:49:09 +00:00
getMaxSteps: (state) => state.max_steps,
2023-02-17 12:29:49 +00:00
},
actions: {
setPolicy(value) {
this.policy = value;
},
2023-02-27 15:49:09 +00:00
setNrWeights(value) {
this.nr_weights = value;
this.weights = Array(this.nr_weights).fill(0);
},
2023-02-17 12:29:49 +00:00
setWeights(value) {
this.weights = value;
},
2023-02-27 15:49:09 +00:00
setMaxSteps(value) {
this.max_steps = value;
2023-02-17 12:29:49 +00:00
},
}
})