docs: bilingual module docs for the ops and sim layers
This commit is contained in:
parent
d94709eb5f
commit
9f96ec7604
|
|
@ -1,4 +1,6 @@
|
||||||
//! The conflict type and the report that collects them.
|
//! The conflict type and the report that collects them.
|
||||||
|
//!
|
||||||
|
//! 冲突类型以及收集它们的报告。
|
||||||
|
|
||||||
use apsis_resource::ResourceId;
|
use apsis_resource::ResourceId;
|
||||||
use apsis_task::TaskId;
|
use apsis_task::TaskId;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! The conflict detection itself.
|
//! The conflict detection itself.
|
||||||
|
//!
|
||||||
|
//! 冲突检测本身。
|
||||||
|
|
||||||
use crate::conflict::{Conflict, ConflictKind, ConflictReport};
|
use crate::conflict::{Conflict, ConflictKind, ConflictReport};
|
||||||
use apsis_resource::{ResourceId, ResourceSet};
|
use apsis_resource::{ResourceId, ResourceSet};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Resource and time conflict detection.
|
//! Resource and time conflict detection.
|
||||||
//!
|
//!
|
||||||
|
//! 资源与时间冲突检测。
|
||||||
|
//!
|
||||||
//! A schedule can be wrong in several ways, and this crate finds them. It
|
//! A schedule can be wrong in several ways, and this crate finds them. It
|
||||||
//! reports conflicts rather than refusing them, so that a plan loaded from a
|
//! reports conflicts rather than refusing them, so that a plan loaded from a
|
||||||
//! file can be checked in full and every problem listed at once instead of
|
//! file can be checked in full and every problem listed at once instead of
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Errors reported while building or querying a resource.
|
//! Errors reported while building or querying a resource.
|
||||||
|
//!
|
||||||
|
//! 构建或查询资源时报告的错误。
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Resource modeling for satellite operations.
|
//! Resource modeling for satellite operations.
|
||||||
//!
|
//!
|
||||||
|
//! 卫星运行的资源建模。
|
||||||
|
//!
|
||||||
//! A resource is anything a task can occupy: a satellite, a ground station, a
|
//! A resource is anything a task can occupy: a satellite, a ground station, a
|
||||||
//! transmitter, an onboard recorder. This crate models the two things a
|
//! transmitter, an onboard recorder. This crate models the two things a
|
||||||
//! scheduler needs to know about one: when it is available, and how much of
|
//! scheduler needs to know about one: when it is available, and how much of
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Resources, their availability, and their capacity.
|
//! Resources, their availability, and their capacity.
|
||||||
|
//!
|
||||||
|
//! 资源、其可用性与容量。
|
||||||
|
|
||||||
use crate::error::{ResourceError, ResourceErrorKind};
|
use crate::error::{ResourceError, ResourceErrorKind};
|
||||||
use crate::window::{Interval, Window, merge_windows, subtract_window};
|
use crate::window::{Interval, Window, merge_windows, subtract_window};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Availability windows and the interval algebra over them.
|
//! Availability windows and the interval algebra over them.
|
||||||
|
//!
|
||||||
|
//! 可用性窗口以及其上的区间代数。
|
||||||
|
|
||||||
use crate::error::{ResourceError, ResourceErrorKind};
|
use crate::error::{ResourceError, ResourceErrorKind};
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Errors reported while building or evaluating a schedule.
|
//! Errors reported while building or evaluating a schedule.
|
||||||
|
//!
|
||||||
|
//! 构建或评估调度时报告的错误。
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Schedule representation and evaluation.
|
//! Schedule representation and evaluation.
|
||||||
//!
|
//!
|
||||||
|
//! 调度的表示与评估。
|
||||||
|
//!
|
||||||
//! A schedule is the answer a scheduler produces: for each task, when it runs
|
//! A schedule is the answer a scheduler produces: for each task, when it runs
|
||||||
//! and on which resources. This crate holds that answer and evaluates it.
|
//! and on which resources. This crate holds that answer and evaluates it.
|
||||||
//! It does not decide the placements, which is the job of `apsis-scheduler`;
|
//! It does not decide the placements, which is the job of `apsis-scheduler`;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Placements and the evaluation of a schedule.
|
//! Placements and the evaluation of a schedule.
|
||||||
|
//!
|
||||||
|
//! 放置以及调度的评估。
|
||||||
|
|
||||||
use apsis_resource::ResourceId;
|
use apsis_resource::ResourceId;
|
||||||
use apsis_task::TaskId;
|
use apsis_task::TaskId;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! The schedule itself.
|
//! The schedule itself.
|
||||||
|
//!
|
||||||
|
//! 调度本身。
|
||||||
|
|
||||||
use crate::error::{ScheduleError, ScheduleErrorKind};
|
use crate::error::{ScheduleError, ScheduleErrorKind};
|
||||||
use crate::placement::{Evaluation, Placement, ResourceUsage};
|
use crate::placement::{Evaluation, Placement, ResourceUsage};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! The building blocks a greedy scheduler needs.
|
//! The building blocks a greedy scheduler needs.
|
||||||
|
//!
|
||||||
|
//! 贪心调度器所需的基本构件。
|
||||||
|
|
||||||
use apsis_resource::{ResourceId, ResourceSet};
|
use apsis_resource::{ResourceId, ResourceSet};
|
||||||
use apsis_schedule::Schedule;
|
use apsis_schedule::Schedule;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! A second pass that tries to place what the greedy first pass left out.
|
//! A second pass that tries to place what the greedy first pass left out.
|
||||||
//!
|
//!
|
||||||
|
//! 第二遍,尝试放置贪心第一遍所遗漏的。
|
||||||
|
//!
|
||||||
//! The greedy pass places each task at the earliest time it fits and never
|
//! The greedy pass places each task at the earliest time it fits and never
|
||||||
//! moves a placement once it is made, so a task that does not fit is lost
|
//! moves a placement once it is made, so a task that does not fit is lost
|
||||||
//! even when moving a placement would make room. This pass addresses the
|
//! even when moving a placement would make room. This pass addresses the
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Scheduling algorithms for satellite task planning.
|
//! Scheduling algorithms for satellite task planning.
|
||||||
//!
|
//!
|
||||||
|
//! 卫星任务规划的调度算法。
|
||||||
|
//!
|
||||||
//! A scheduler takes a list of tasks and a set of resources and produces a
|
//! A scheduler takes a list of tasks and a set of resources and produces a
|
||||||
//! schedule. This crate provides a greedy scheduler and the pieces needed to
|
//! schedule. This crate provides a greedy scheduler and the pieces needed to
|
||||||
//! build others.
|
//! build others.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! The greedy planner.
|
//! The greedy planner.
|
||||||
|
//!
|
||||||
|
//! 贪心规划器。
|
||||||
|
|
||||||
use crate::greedy::infeasible_tasks;
|
use crate::greedy::infeasible_tasks;
|
||||||
use crate::improve::{ImprovementSettings, improve};
|
use crate::improve::{ImprovementSettings, improve};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! The earliest start search, done in one pass over the schedule.
|
//! The earliest start search, done in one pass over the schedule.
|
||||||
//!
|
//!
|
||||||
|
//! 最早开始搜索,对调度做一遍完成。
|
||||||
|
//!
|
||||||
//! The sequential form asks the same question in a loop: it lists every time
|
//! The sequential form asks the same question in a loop: it lists every time
|
||||||
//! at which feasibility could change, sorts them, and tests each in turn until
|
//! at which feasibility could change, sorts them, and tests each in turn until
|
||||||
//! one passes. That is correct but it recomputes the busy profile of every
|
//! one passes. That is correct but it recomputes the busy profile of every
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Errors reported while building or querying a task.
|
//! Errors reported while building or querying a task.
|
||||||
|
//!
|
||||||
|
//! 构建或查询任务时报告的错误。
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Task modeling for satellite operations.
|
//! Task modeling for satellite operations.
|
||||||
//!
|
//!
|
||||||
|
//! 卫星运行的任务建模。
|
||||||
|
//!
|
||||||
//! A task is a unit of work that a scheduler places on a set of resources. It
|
//! A task is a unit of work that a scheduler places on a set of resources. It
|
||||||
//! carries everything a scheduler needs to decide whether and where to run
|
//! carries everything a scheduler needs to decide whether and where to run
|
||||||
//! it: how long it takes, when it may run, which resources it needs and in
|
//! it: how long it takes, when it may run, which resources it needs and in
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Precedence constraints between tasks.
|
//! Precedence constraints between tasks.
|
||||||
//!
|
//!
|
||||||
|
//! 任务之间的先后约束。
|
||||||
|
//!
|
||||||
//! A precedence constraint says that one task must finish before another
|
//! A precedence constraint says that one task must finish before another
|
||||||
//! starts. A set of such constraints forms a directed acyclic graph, and a
|
//! starts. A set of such constraints forms a directed acyclic graph, and a
|
||||||
//! scheduler must respect it: a task cannot be placed until every task that
|
//! scheduler must respect it: a task cannot be placed until every task that
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Tasks, their requirements, and the set that holds them.
|
//! Tasks, their requirements, and the set that holds them.
|
||||||
|
//!
|
||||||
|
//! 任务、其需求,以及保存它们的集合。
|
||||||
|
|
||||||
use crate::error::{TaskError, TaskErrorKind};
|
use crate::error::{TaskError, TaskErrorKind};
|
||||||
use apsis_resource::ResourceId;
|
use apsis_resource::ResourceId;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! The event type and its identifier.
|
//! The event type and its identifier.
|
||||||
|
//!
|
||||||
|
//! 事件类型及其标识符。
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Simulation event types and event queue.
|
//! Simulation event types and event queue.
|
||||||
//!
|
//!
|
||||||
|
//! 仿真事件类型与事件队列。
|
||||||
|
//!
|
||||||
//! A discrete-event simulation advances by jumping from one event to the
|
//! A discrete-event simulation advances by jumping from one event to the
|
||||||
//! next rather than by stepping through every instant. This crate provides
|
//! next rather than by stepping through every instant. This crate provides
|
||||||
//! the queue that makes that possible: a priority queue ordered by time,
|
//! the queue that makes that possible: a priority queue ordered by time,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! The event queue.
|
//! The event queue.
|
||||||
|
//!
|
||||||
|
//! 事件队列。
|
||||||
|
|
||||||
use crate::event::{Event, EventId};
|
use crate::event::{Event, EventId};
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Simulation output recording.
|
//! Simulation output recording.
|
||||||
//!
|
//!
|
||||||
|
//! 仿真输出记录。
|
||||||
|
//!
|
||||||
//! A simulation produces more output than a caller can act on at once: event
|
//! A simulation produces more output than a caller can act on at once: event
|
||||||
//! times, the values a model computes as it runs, and the warnings it raises.
|
//! times, the values a model computes as it runs, and the warnings it raises.
|
||||||
//! This crate collects those into one trace, so that a run can be examined
|
//! This crate collects those into one trace, so that a run can be examined
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! One recorded value.
|
//! One recorded value.
|
||||||
|
//!
|
||||||
|
//! 一条被记录的值。
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Building a trace as a simulation runs.
|
//! Building a trace as a simulation runs.
|
||||||
|
//!
|
||||||
|
//! 在仿真运行过程中构建轨迹。
|
||||||
|
|
||||||
use crate::record::{Record, RecordKind};
|
use crate::record::{Record, RecordKind};
|
||||||
use crate::trace::Trace;
|
use crate::trace::Trace;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! The trace and its summaries.
|
//! The trace and its summaries.
|
||||||
|
//!
|
||||||
|
//! 轨迹及其各汇总。
|
||||||
|
|
||||||
use crate::record::{Record, RecordKind};
|
use crate::record::{Record, RecordKind};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Errors reported while building, loading, or validating a scenario.
|
//! Errors reported while building, loading, or validating a scenario.
|
||||||
|
//!
|
||||||
|
//! 构建、加载或校验场景时报告的错误。
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Scenario definition and loading.
|
//! Scenario definition and loading.
|
||||||
//!
|
//!
|
||||||
|
//! 场景的定义与加载。
|
||||||
|
//!
|
||||||
//! A scenario is a simulation's initial conditions: the resources a plan may
|
//! A scenario is a simulation's initial conditions: the resources a plan may
|
||||||
//! use, the tasks it must place, the precedence constraints between those
|
//! use, the tasks it must place, the precedence constraints between those
|
||||||
//! tasks, and the limits the run should respect. It is the input a run is
|
//! tasks, and the limits the run should respect. It is the input a run is
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Reading a scenario from its text form.
|
//! Reading a scenario from its text form.
|
||||||
|
//!
|
||||||
|
//! 由其文本形式读取场景。
|
||||||
|
|
||||||
use crate::error::{ScenarioError, ScenarioErrorKind};
|
use crate::error::{ScenarioError, ScenarioErrorKind};
|
||||||
use crate::scenario::Scenario;
|
use crate::scenario::Scenario;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! The scenario type and its text form.
|
//! The scenario type and its text form.
|
||||||
|
//!
|
||||||
|
//! 场景类型及其文本形式。
|
||||||
|
|
||||||
use crate::error::{ScenarioError, ScenarioErrorKind};
|
use crate::error::{ScenarioError, ScenarioErrorKind};
|
||||||
use apsis_resource::{Resource, ResourceSet};
|
use apsis_resource::{Resource, ResourceSet};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! The engine itself.
|
//! The engine itself.
|
||||||
|
//!
|
||||||
|
//! 引擎本身。
|
||||||
|
|
||||||
use crate::outcome::{EngineOutcome, EngineState, StopReason};
|
use crate::outcome::{EngineOutcome, EngineState, StopReason};
|
||||||
use apsis_event::{Event, EventId, EventQueue};
|
use apsis_event::{Event, EventId, EventQueue};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Discrete-event simulation engine.
|
//! Discrete-event simulation engine.
|
||||||
//!
|
//!
|
||||||
|
//! 离散事件仿真引擎。
|
||||||
|
//!
|
||||||
//! The engine advances a clock by jumping from one event to the next. It
|
//! The engine advances a clock by jumping from one event to the next. It
|
||||||
//! holds the event queue, the current simulation time, and the statistics a
|
//! holds the event queue, the current simulation time, and the statistics a
|
||||||
//! caller needs to judge a run. What an event means is the caller's: it
|
//! caller needs to judge a run. What an event means is the caller's: it
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! What a run produced and what the engine currently holds.
|
//! What a run produced and what the engine currently holds.
|
||||||
|
//!
|
||||||
|
//! 一次运行所产生的结果以及引擎当前所持有的状态。
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! What happens at an instant in a simulated timeline.
|
//! What happens at an instant in a simulated timeline.
|
||||||
|
//!
|
||||||
|
//! 仿真时间线中某瞬时发生的事。
|
||||||
|
|
||||||
use apsis_task::TaskId;
|
use apsis_task::TaskId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Errors reported while preparing or starting a simulation.
|
//! Errors reported while preparing or starting a simulation.
|
||||||
|
//!
|
||||||
|
//! 准备或启动仿真时报告的错误。
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
//! Simulation facade that integrates the simulation layer.
|
//! Simulation facade that integrates the simulation layer.
|
||||||
//!
|
//!
|
||||||
|
//! 整合仿真层的仿真门面。
|
||||||
|
//!
|
||||||
//! This crate is the single entry point to the simulation layer. It ties the
|
//! This crate is the single entry point to the simulation layer. It ties the
|
||||||
//! four pieces together: a [`Scenario`] describes the initial conditions, the
|
//! four pieces together: a [`Scenario`] describes the initial conditions, the
|
||||||
//! ops layer plans it, the engine runs the resulting timeline, and a
|
//! ops layer plans it, the engine runs the resulting timeline, and a
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Running a prepared simulation.
|
//! Running a prepared simulation.
|
||||||
|
//!
|
||||||
|
//! 运行已准备的仿真。
|
||||||
|
|
||||||
use crate::activity::Activity;
|
use crate::activity::Activity;
|
||||||
use crate::simulation::Simulation;
|
use crate::simulation::Simulation;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
//! Preparing a scenario for a run.
|
//! Preparing a scenario for a run.
|
||||||
|
//!
|
||||||
|
//! 为一次运行准备场景。
|
||||||
|
|
||||||
use crate::activity::Activity;
|
use crate::activity::Activity;
|
||||||
use crate::error::{SimulationError, SimulationErrorKind};
|
use crate::error::{SimulationError, SimulationErrorKind};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue