use precedence_net::{DurationType, Network, Result, StartType}; fn main() -> Result<()> { let mut network_builder = Network::builder(); let nodes = vec!["a", "b", "c", "d", "e", "f", "g", "h"]; for node in nodes { network_builder.add_extended_activity( node, &format!("Node {}", node), 1.0, 2.0, 3.0, StartType::Earliest, DurationType::Expected, )?; } network_builder.connect("a", "b")?; network_builder.connect("b", "c")?; network_builder.connect("b", "d")?; network_builder.connect("d", "e")?; network_builder.connect("e", "f")?; network_builder.connect("e", "g")?; network_builder.connect("f", "h")?; let network = Network::try_from(network_builder)?; println!("{}", network.to_dot()?); Ok(()) }