manually finished

This commit is contained in:
Niko Feith 2023-03-06 15:43:53 +01:00
parent 351b63da6b
commit a21bf5b045
2 changed files with 39 additions and 15 deletions

View File

@ -13,7 +13,8 @@
:step="1"
:min="10"
:max="200"
thumb-label/>
thumb-label
/>
<v-slider
class="control-slider"
label="nr base funcs"
@ -21,7 +22,8 @@
:step="1"
:min="2"
:max="20"
thumb-label/>
thumb-label
/>
<v-slider
class="control-slider"
label="nr episodes"
@ -29,7 +31,9 @@
:step="1"
:min="10"
:max="200"
thumb-label/>
thumb-label
:disabled="episodeRef"
/>
<v-slider
class="control-slider"
label="nr runs"
@ -37,7 +41,9 @@
:step="1"
:min="1"
:max="50"
thumb-label/>
thumb-label
:disabled="runRef"
/>
<v-slider
class="control-slider"
label="greedy"
@ -45,7 +51,9 @@
:step="0.01"
:min="0"
:max="1"
thumb-label/>
thumb-label
:disabled="greedyRef"
/>
<v-row class="d-flex justify-space-evenly mb-9">
<v-btn color="primary" @click="cstore.setSendWeights()">Send Weights</v-btn>
<v-btn color="secondary" @click="cstore.setRunner()">Run</v-btn>
@ -57,21 +65,17 @@
<script setup>
import {usePStore} from "@/store/PolicyStore";
import {useCStore} from "@/store/ControlStore";
import {computed} from "vue";
import {computed, watch, ref} from "vue";
const pstore = usePStore();
const cstore = useCStore();
const options = cstore.user_modes;
const selectedOption = cstore.mode;
const sliders = [
{ min: 10, max: 200, value: pstore.max_steps, name: 'max steps', action: pstore.setMaxSteps},
{ min: 5, max: 10, value: pstore.nr_weights, name: 'nr base funs', action: pstore.setNrWeights},
{ min: 10, max: 200, value: cstore.nr_episodes, name: 'nr episodes', action: cstore.setNrEpisodes},
{ min: 1, max: 100, value: cstore.nr_runs, name: 'nr runs', action: cstore.setNrRuns},
{ min: 0, max: 1, value: cstore.greedy, name: 'greedy', action: cstore.setGreedy},
];
const episodeRef = ref(false);
const runRef = ref(true);
const greedyRef = ref(true);
const baseFuncsComp = computed({
get: () => pstore.nr_weights,
set: (value) => pstore.setNrWeights(value),
@ -81,6 +85,26 @@ const modeSelector = computed({
get: () => cstore.mode,
set: (value) => cstore.setUserMode(value)
})
watch(() => cstore.getUserMode, () => {
const usrMode = cstore.getUserMode;
if (usrMode === 'manually') {
episodeRef.value = true;
runRef.value = true;
greedyRef.value = true;
}
if (usrMode === 'BO') {
episodeRef.value = false;
runRef.value = false;
greedyRef.value = true;
}
if (usrMode === 'active BO') {
episodeRef.value = false;
runRef.value = false;
greedyRef.value = false;
}
});
</script>
<style scoped>

View File

@ -3,7 +3,7 @@ import { defineStore } from "pinia";
export const useCStore = defineStore('Control Store', {
state: () => {
return {
mode: null,
mode: 'manually',
user_modes: ['manually', 'BO', 'active BO'],
nr_episodes: 10,
nr_runs: 1,