AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
RewardChart.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using System.Collections;
9 using UnityEngine;
10 using Commons;
11 using System;
12 using Communicator;
13 
15 {
16  [DisallowMultipleComponent]
17  public class RewardChart : MonoBehaviour
18  {
19  private LineChart chart;
20  private Serie serie;
21 
22  void Start()
23  {
24 
25  chart = gameObject.GetComponent<LineChart>();
26  if (chart == null) chart = gameObject.AddComponent<LineChart>();
27  chart.title.text = "Reward";
28  chart.RefreshAxisMinMaxValue();
29  chart.yAxis0.minMaxType = Axis.AxisMinMaxType.Custom;
30  chart.RemoveData();
31  serie = chart.AddSerie(SerieType.Line, "Line");
32  //resetting the reward in the chart
33  chart.AddData(0, 0.0f);
34  StaticOutputSchema.Reward = 0;
35 
36  }
37 
38  void Update()
39  {
40  Double fc = Math.Round(StaticOutputSchema.Reward,1);
41  chart.AddData(0, fc);
42  }
43 
44 
45 
46 
47  }
48 }
XCharts.CoordinateChart.RemoveData
override void RemoveData()
Remove all data from series,legend and axis. The series list is also cleared. 清空所有图例,系列和坐标轴类目数据。系列的列表...
Definition: CoordinateChart_API.cs:71
XCharts.SerieType
SerieType
the type of serie. 系列类型。
Definition: Serie.cs:19
XCharts.CoordinateChart.yAxis0
YAxis? yAxis0
Y轴(左)
Definition: CoordinateChart_API.cs:48
XCharts.Axis
The axis in rectangular coordinate. 直角坐标系的坐标轴组件。
Definition: Axis.cs:20
XCharts.LineChart
Definition: LineChart.cs:17
XCharts.Examples.RewardChart
Definition: RewardChart.cs:17
XCharts.Serie
系列。每个系列通过 type 决定自己的图表类型。
Definition: Serie.cs:261
XCharts.Examples
Definition: RewardChart.cs:14
XCharts.Axis.minMaxType
AxisMinMaxType minMaxType
the type of axis minmax. 坐标轴刻度最大最小值显示类型。
Definition: Axis.cs:139
Communicator
Definition: InputHandle.cs:10
XCharts.CoordinateChart.RefreshAxisMinMaxValue
void RefreshAxisMinMaxValue()
立即刷新数值坐标轴的最大最小值
Definition: CoordinateChart_API.cs:311
Commons
Definition: AirplaneProperties.cs:14
XCharts.Axis.AxisMinMaxType
AxisMinMaxType
the type of axis min and max value. 坐标轴最大最小刻度显示类型。
Definition: Axis.cs:54