Struct precedence_net::NetworkBuilder
source · pub struct NetworkBuilder { /* private fields */ }
Implementations§
source§impl NetworkBuilder
impl NetworkBuilder
sourcepub fn add_activity(&mut self, reference: &str, duration: f64) -> Result<()>
pub fn add_activity(&mut self, reference: &str, duration: f64) -> Result<()>
Add an activity to the network.
The reference
and description
of the activity will be set to reference
. The minimum_duration
, expected_duration
and maximum_duration
will all be set to duration
. The start_type
will be set to StartType::Earliest
and the duration_type
will be set to DurationType::Expected
.
sourcepub fn remove_activity(&mut self, reference: &str) -> Result<()>
pub fn remove_activity(&mut self, reference: &str) -> Result<()>
Removes an activity and all edges associated with it
pub fn remove_edge( &mut self, origin_reference: &str, target_reference: &str ) -> Result<()>
sourcepub fn add_extended_activity(
&mut self,
reference: &str,
description: &str,
minimum_duration: f64,
expected_duration: f64,
maximum_duration: f64,
start_type: StartType,
duration_type: DurationType
) -> Result<()>
pub fn add_extended_activity( &mut self, reference: &str, description: &str, minimum_duration: f64, expected_duration: f64, maximum_duration: f64, start_type: StartType, duration_type: DurationType ) -> Result<()>
Add a customised activity to the network.
This method is for creating activities with differing durations, start types or duration types.
ⓘ
network_builder.add_extended_activity("develop",
"Develop System",
1.0, 3.0, 5.0,
StartType::Earliest,
DurationType::Expected)?;
sourcepub fn connect(
&mut self,
origin_reference: &str,
target_reference: &str
) -> Result<()>
pub fn connect( &mut self, origin_reference: &str, target_reference: &str ) -> Result<()>
Connect two activities together
ⓘ
// a -> b -> c
network_builder.connect("a", "b")?;
network_builder.connect("b", "c")?;
pub fn update_activity<F>( &mut self, reference: &str, with_activity_builder: F ) -> Result<()>where F: FnOnce(&mut ActivityBuilder),
Trait Implementations§
source§impl Default for NetworkBuilder
impl Default for NetworkBuilder
source§fn default() -> NetworkBuilder
fn default() -> NetworkBuilder
Returns the “default value” for a type. Read more
source§impl From<&Network> for NetworkBuilder
impl From<&Network> for NetworkBuilder
source§fn from(network: &Network) -> NetworkBuilder
fn from(network: &Network) -> NetworkBuilder
Converts to this type from the input type.
source§impl From<Network> for NetworkBuilder
impl From<Network> for NetworkBuilder
source§fn from(network: Network) -> NetworkBuilder
fn from(network: Network) -> NetworkBuilder
Converts to this type from the input type.