Hi Bijal,
in SUMO node ids are always strings but if you are sure that your ids
are always integers then you can simply convert them using python's int
function.

Best regards,
Michael

Am 27.03.19 um 10:25 schrieb Bijal:
> Dear Sir,
> 
> I have converted Graph to Adjacency Matrix. But it gives wrong
> intersection values.
> 
> My problem is i am not able to understand why the value
> of edge.getToNode().getID() shows u'5' (variable type shows Unicode) in
> place of Value 5? [Please find photo attached here with]
> 
> I need integer values because i am doing following :
> 
>   def add_edge(self, u, v, weight=1):
>         if u in self.vertices and v in self.vertices:
>          *  self.edges[self.edge_indices[u]][self.edge_indices[v]] = weight*
>             self.edges[self.edge_indices[v]][self.edge_indices[u]] = weight
>             return True
>         else:
>             return False
> Please help me to solve this issue.
> image.png
> 
> 
> -- 
> *:)*
> Bijal Varia
> 
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
> 


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to