File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ impl IONetwork {
146146
147147 // to make via swollow this, it neads an xml tag, as well as a dtd header.
148148 let network_header = "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n <!DOCTYPE network SYSTEM \" http://www.matsim.org/files/dtd/network_v2.dtd\" >" ;
149- writer. write ( network_header. as_ref ( ) ) . unwrap ( ) ;
149+ writer. write_all ( network_header. as_ref ( ) ) . unwrap ( ) ;
150150
151151 // write the actual network
152152 to_writer ( writer, self ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -235,8 +235,10 @@ pub(self) fn find_edge_id_of_outgoing(
235235 next_node : NodeId ,
236236 network : & RoutingKitNetwork ,
237237) -> u64 {
238- //TODO this is marked as unnecessary comparison - why?
239- assert ! ( last_out_index - first_out_index >= 0 , "No outgoing edges!" ) ;
238+ assert ! (
239+ last_out_index as i64 - first_out_index as i64 >= 0 ,
240+ "No outgoing edges!"
241+ ) ;
240242 let mut result = None ;
241243 for i in first_out_index..=last_out_index {
242244 if * network. head . get ( i) . unwrap ( ) == next_node {
Original file line number Diff line number Diff line change @@ -105,16 +105,14 @@ impl<'sim> Simulation<'sim> {
105105 ) ;
106106
107107 if self . router . is_some ( ) {
108- if !agent. curr_act ( ) . is_interaction ( ) && agent. next_act ( ) . is_interaction ( ) {
109- self . update_walk_leg ( & mut agent) ;
110- } else if agent . curr_act ( ) . is_interaction ( ) && !agent . next_act ( ) . is_interaction ( ) {
108+ if ( !agent. curr_act ( ) . is_interaction ( ) && agent. next_act ( ) . is_interaction ( ) )
109+ || ( agent . curr_act ( ) . is_interaction ( ) && ! agent. next_act ( ) . is_interaction ( ) )
110+ {
111111 self . update_walk_leg ( & mut agent) ;
112112 } else if agent. curr_act ( ) . is_interaction ( ) && agent. next_act ( ) . is_interaction ( ) {
113113 self . update_main_leg ( & mut agent) ;
114114 } else {
115- panic ! (
116- "Computing a leg between two interaction activities should never happen."
117- )
115+ panic ! ( "Computing a leg between two main activities should never happen." )
118116 }
119117 }
120118
You can’t perform that action at this time.
0 commit comments