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,9 +55,8 @@ function buildChart() {
|
|||||||
autoSkip: true,
|
autoSkip: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
y:
|
y: {
|
||||||
{
|
type: "linear",
|
||||||
type: 'linear',
|
|
||||||
ticks: {
|
ticks: {
|
||||||
beginAtZero: true,
|
beginAtZero: true,
|
||||||
},
|
},
|
||||||
@ -63,7 +64,7 @@ function buildChart() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
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(
|
||||||
|
() => store.getPolicy,
|
||||||
|
() => {
|
||||||
const policy = store.getPolicy;
|
const policy = store.getPolicy;
|
||||||
const policy_labels = Array(policy.length).fill(0).map((_, i) => i)
|
chartHandle.options.scales.x.labels = Array(policy.length)
|
||||||
|
.fill(0)
|
||||||
chartHandle.options.scales.x.labels = policy_labels;
|
.map((_, i) => i);
|
||||||
chartHandle.data.datasets[0].data = policy;
|
chartHandle.data.datasets[0].data = policy;
|
||||||
|
|
||||||
chartHandle.update();
|
chartHandle.update();
|
||||||
});
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row no-gutters justify="center" class="weight-tuner">
|
<v-row no-gutters justify="center" class="weight-tuner">
|
||||||
|
<!-- eslint-disable-next-line -->
|
||||||
<v-col v-for="(_, idx) in weights">
|
<v-col v-for="(_, idx) in weights">
|
||||||
<div class="weight-container">
|
<div class="weight-container">
|
||||||
<vue-slider v-model="weights[idx]"
|
<vue-slider
|
||||||
|
v-model="weights[idx]"
|
||||||
direction="btt"
|
direction="btt"
|
||||||
:height="100"
|
:height="100"
|
||||||
:min="-1"
|
:min="-1"
|
||||||
@ -18,13 +20,12 @@
|
|||||||
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