clean up
This commit is contained in:
parent
c0abdae2e8
commit
9e61c3244b
5
.idea/.gitignore
vendored
Normal file
5
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
@ -39,7 +39,7 @@
|
|||||||
label="nr runs"
|
label="nr runs"
|
||||||
v-model="cstore.nr_runs"
|
v-model="cstore.nr_runs"
|
||||||
:step="1"
|
:step="1"
|
||||||
:min="2"
|
:min="1"
|
||||||
:max="50"
|
:max="50"
|
||||||
thumb-label
|
thumb-label
|
||||||
:disabled="runRef"
|
:disabled="runRef"
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<canvas id="policy-chart"/>
|
<canvas id="policy-chart" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, watch } from "vue";
|
import { onMounted, watch } from "vue";
|
||||||
import { usePStore } from "@/store/PolicyStore";
|
import { usePStore } from "@/store/PolicyStore";
|
||||||
import { Chart } from 'chart.js/auto';
|
import { Chart } from "chart.js/auto";
|
||||||
|
|
||||||
const store = usePStore();
|
const store = usePStore();
|
||||||
|
|
||||||
@ -13,16 +13,18 @@ let chartHandle;
|
|||||||
|
|
||||||
function buildChart() {
|
function buildChart() {
|
||||||
const policy = store.getPolicy;
|
const policy = store.getPolicy;
|
||||||
const policy_labels = Array(policy.length).fill(0).map((_, i) => i);
|
const policy_labels = Array(policy.length)
|
||||||
|
.fill(0)
|
||||||
|
.map((_, i) => i);
|
||||||
const RewardPlot = {
|
const RewardPlot = {
|
||||||
data: {
|
data: {
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
type: 'line',
|
type: "line",
|
||||||
xAxisID: 'x',
|
xAxisID: "x",
|
||||||
yAxisID: 'y',
|
yAxisID: "y",
|
||||||
data: policy,
|
data: policy,
|
||||||
borderColor: '#3DC47A',
|
borderColor: "#3DC47A",
|
||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
pointRadius: 0,
|
pointRadius: 0,
|
||||||
},
|
},
|
||||||
@ -34,14 +36,14 @@ function buildChart() {
|
|||||||
animation: {
|
animation: {
|
||||||
duration: 0,
|
duration: 0,
|
||||||
},
|
},
|
||||||
plugins:{
|
plugins: {
|
||||||
legend: {
|
legend: {
|
||||||
display: false,
|
display: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
tooltip: {
|
tooltip: {
|
||||||
mode: 'label',
|
mode: "label",
|
||||||
},
|
},
|
||||||
scales: {
|
scales: {
|
||||||
x: {
|
x: {
|
||||||
@ -53,17 +55,16 @@ function buildChart() {
|
|||||||
autoSkip: true,
|
autoSkip: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
y:
|
y: {
|
||||||
{
|
type: "linear",
|
||||||
type: 'linear',
|
ticks: {
|
||||||
ticks: {
|
beginAtZero: true,
|
||||||
beginAtZero: true,
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const ctx = document.getElementById('policy-chart');
|
const ctx = document.getElementById("policy-chart");
|
||||||
// eslint-disable-next-line no-new
|
// eslint-disable-next-line no-new
|
||||||
chartHandle = new Chart(ctx, RewardPlot);
|
chartHandle = new Chart(ctx, RewardPlot);
|
||||||
}
|
}
|
||||||
@ -72,18 +73,18 @@ onMounted(() => {
|
|||||||
buildChart();
|
buildChart();
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(() => store.getPolicy, () => {
|
watch(
|
||||||
const policy = store.getPolicy;
|
() => store.getPolicy,
|
||||||
const policy_labels = Array(policy.length).fill(0).map((_, i) => i)
|
() => {
|
||||||
|
const policy = store.getPolicy;
|
||||||
chartHandle.options.scales.x.labels = policy_labels;
|
chartHandle.options.scales.x.labels = Array(policy.length)
|
||||||
chartHandle.data.datasets[0].data = policy;
|
.fill(0)
|
||||||
|
.map((_, i) => i);
|
||||||
chartHandle.update();
|
chartHandle.data.datasets[0].data = policy;
|
||||||
});
|
|
||||||
|
|
||||||
|
chartHandle.update();
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
@ -1,30 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row no-gutters justify="center" class="weight-tuner">
|
<v-row no-gutters justify="center" class="weight-tuner">
|
||||||
<v-col v-for="(_, idx) in weights">
|
<!-- eslint-disable-next-line -->
|
||||||
<div class="weight-container">
|
<v-col v-for="(_, idx) in weights">
|
||||||
<vue-slider v-model="weights[idx]"
|
<div class="weight-container">
|
||||||
direction="btt"
|
<vue-slider
|
||||||
:height="100"
|
v-model="weights[idx]"
|
||||||
:min="-1"
|
direction="btt"
|
||||||
:max="1"
|
:height="100"
|
||||||
:interval="0.01"
|
:min="-1"
|
||||||
/>
|
:max="1"
|
||||||
</div>
|
:interval="0.01"
|
||||||
</v-col>
|
/>
|
||||||
</v-row>
|
</div>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { usePStore } from "@/store/PolicyStore";
|
import { usePStore } from "@/store/PolicyStore";
|
||||||
|
|
||||||
import VueSlider from "vue-slider-component";
|
import VueSlider from "vue-slider-component";
|
||||||
import 'vue-slider-component/theme/default.css';
|
import "vue-slider-component/theme/default.css";
|
||||||
import {computed} from "vue";
|
import { computed } from "vue";
|
||||||
|
|
||||||
const store = usePStore()
|
const store = usePStore();
|
||||||
|
|
||||||
const weights = computed(() => store.weights);
|
const weights = computed(() => store.weights);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -11,8 +11,8 @@ export const useCStore = defineStore("Control Store", {
|
|||||||
"Probability of Improvement",
|
"Probability of Improvement",
|
||||||
"Upper Confidence Bound",
|
"Upper Confidence Bound",
|
||||||
],
|
],
|
||||||
nr_episodes: 10,
|
nr_episodes: 50,
|
||||||
nr_runs: 2,
|
nr_runs: 10,
|
||||||
greedy: 0,
|
greedy: 0,
|
||||||
sendWeights: false,
|
sendWeights: false,
|
||||||
runner: false,
|
runner: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user