pub struct TrainSimBuilder {
pub train_id: String,
pub train_config: TrainConfig,
pub loco_con: Consist,
pub origin_id: Option<String>,
pub destination_id: Option<String>,
/* private fields */
}Fields§
§train_id: StringUnique, user-defined identifier for the train
train_config: TrainConfig§loco_con: Consist§origin_id: Option<String>Origin_ID from train planner to map to track network locations. Only needed if Self::make_speed_limit_train_sim will be called.
destination_id: Option<String>Destination_ID from train planner to map to track network locations. Only needed if Self::make_speed_limit_train_sim will be called.
Implementations§
Source§impl TrainSimBuilder
impl TrainSimBuilder
pub fn new( train_id: String, train_config: TrainConfig, loco_con: Consist, origin_id: Option<String>, destination_id: Option<String>, init_train_state: Option<InitTrainState>, ) -> Self
pub fn make_set_speed_train_sim<Q: AsRef<[Link]>, R: AsRef<[LinkIdx]>>( &self, network: Q, link_path: R, speed_trace: SpeedTrace, save_interval: Option<usize>, temp_trace: Option<TemperatureTrace>, ) -> Result<SetSpeedTrainSim>
pub fn make_set_speed_train_sim_and_parts<Q: AsRef<[Link]>, R: AsRef<[LinkIdx]>>( &self, network: Q, link_path: R, speed_trace: SpeedTrace, save_interval: Option<usize>, temp_trace: Option<TemperatureTrace>, ) -> Result<(SetSpeedTrainSim, TrainParams, PathTpc, TrainRes, FricBrake)>
pub fn make_speed_limit_train_sim( &self, location_map: &LocationMap, save_interval: Option<usize>, simulation_days: Option<i32>, scenario_year: Option<i32>, temp_trace: Option<TemperatureTrace>, ) -> Result<SpeedLimitTrainSim>
pub fn make_speed_limit_train_sim_and_parts( &self, location_map: &LocationMap, save_interval: Option<usize>, simulation_days: Option<i32>, scenario_year: Option<i32>, temp_trace: Option<TemperatureTrace>, ) -> Result<(SpeedLimitTrainSim, PathTpc, TrainRes, FricBrake)>
Trait Implementations§
Source§impl Clone for TrainSimBuilder
impl Clone for TrainSimBuilder
Source§fn clone(&self) -> TrainSimBuilder
fn clone(&self) -> TrainSimBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrainSimBuilder
impl Debug for TrainSimBuilder
Source§impl Default for TrainSimBuilder
impl Default for TrainSimBuilder
Source§fn default() -> TrainSimBuilder
fn default() -> TrainSimBuilder
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TrainSimBuilder
impl<'de> Deserialize<'de> for TrainSimBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Init for TrainSimBuilder
impl Init for TrainSimBuilder
Source§impl PartialEq for TrainSimBuilder
impl PartialEq for TrainSimBuilder
Source§impl SerdeAPI for TrainSimBuilder
impl SerdeAPI for TrainSimBuilder
const ACCEPTED_BYTE_FORMATS: &'static [&'static str] = _
const ACCEPTED_STR_FORMATS: &'static [&'static str] = _
const RESOURCES_SUBDIR: &'static str = ""
const RESOURCES_DIR: &'static Dir<'_> = _
Source§fn from_resource<P: AsRef<Path>>(
filepath: P,
skip_init: bool,
) -> Result<Self, Error>
fn from_resource<P: AsRef<Path>>( filepath: P, skip_init: bool, ) -> Result<Self, Error>
Read (deserialize) an object from a resource file packaged with the
altrios-core crate Read moreSource§fn list_resources() -> Result<Vec<PathBuf>, Error>
fn list_resources() -> Result<Vec<PathBuf>, Error>
List the available resources in the resources directory Read more
Source§fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<()>
fn to_file<P: AsRef<Path>>(&self, filepath: P) -> Result<()>
Write (serialize) an object to a file.
Supported file extensions are listed in
ACCEPTED_BYTE_FORMATS.
Creates a new file if it does not already exist, otherwise truncates the existing file. Read moreSource§fn from_file<P: AsRef<Path>>(
filepath: P,
skip_init: bool,
) -> Result<Self, Error>
fn from_file<P: AsRef<Path>>( filepath: P, skip_init: bool, ) -> Result<Self, Error>
Read (deserialize) an object from a file.
Supported file extensions are listed in
ACCEPTED_BYTE_FORMATS. Read moreSource§fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<()>
fn to_writer<W: Write>(&self, wtr: W, format: &str) -> Result<()>
Write (serialize) an object into anything that implements
std::io::Write Read moreSource§fn to_str(&self, format: &str) -> Result<String>
fn to_str(&self, format: &str) -> Result<String>
Write (serialize) an object into a string Read more
Source§fn from_str<S: AsRef<str>>(
contents: S,
format: &str,
skip_init: bool,
) -> Result<Self>
fn from_str<S: AsRef<str>>( contents: S, format: &str, skip_init: bool, ) -> Result<Self>
Read (deserialize) an object from a string Read more
Source§fn from_reader<R: Read>(
rdr: &mut R,
format: &str,
skip_init: bool,
) -> Result<Self, Error>
fn from_reader<R: Read>( rdr: &mut R, format: &str, skip_init: bool, ) -> Result<Self, Error>
Deserialize an object from anything that implements
std::io::Read Read moreSource§fn from_json<S: AsRef<str>>(json_str: S, skip_init: bool) -> Result<Self>
fn from_json<S: AsRef<str>>(json_str: S, skip_init: bool) -> Result<Self>
Read (deserialize) an object from a JSON string Read more
Source§fn from_msg_pack(msg_pack: &[u8], skip_init: bool) -> Result<Self>
fn from_msg_pack(msg_pack: &[u8], skip_init: bool) -> Result<Self>
Read (deserialize) an object from a message pack Read more
Source§impl Serialize for TrainSimBuilder
impl Serialize for TrainSimBuilder
impl StructuralPartialEq for TrainSimBuilder
Auto Trait Implementations§
impl Freeze for TrainSimBuilder
impl RefUnwindSafe for TrainSimBuilder
impl Send for TrainSimBuilder
impl Sync for TrainSimBuilder
impl Unpin for TrainSimBuilder
impl UnwindSafe for TrainSimBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EqDefault for T
impl<T> EqDefault for T
Source§fn eq_default(&self) -> bool
fn eq_default(&self) -> bool
Checks if an instance of
Self is equal to Self::defaultSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more