1use serde::{Deserialize, Serialize};
2use serde_with::skip_serializing_none;
3
4use crate::{config::配置, 原始可编码对象, 原始当量信息, 原始键位分布信息};
5
6pub mod command_line;
7pub mod web;
8pub mod server;
9
10#[derive(Serialize)]
12#[serde(tag = "type", rename_all = "snake_case")]
13#[skip_serializing_none]
14pub enum 消息 {
15 TrialMax {
16 temperature: f64,
17 accept_rate: f64,
18 },
19 TrialMin {
20 temperature: f64,
21 improve_rate: f64,
22 },
23 Parameters {
24 t_max: f64,
25 t_min: f64,
26 },
27 Progress {
28 steps: usize,
29 temperature: f64,
30 config: String,
31 metric: String,
32 score: f64,
33 },
34 BetterSolution {
35 index: Option<u64>,
36 config: String,
37 metric: String,
38 score: f64,
39 },
40 Elapsed {
41 time: u64,
42 },
43}
44
45pub trait 界面 {
49 fn 发送(&self, 消息: 消息);
50}
51
52#[derive(Debug, Default, Clone, Serialize, Deserialize)]
54pub struct 默认输入 {
55 pub 配置: 配置,
56 pub 词列表: Vec<原始可编码对象>,
57 pub 原始键位分布信息: 原始键位分布信息,
58 pub 原始当量信息: 原始当量信息,
59}