Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Convert sumolib.net.readnet Graph to Adjacency Matrix (Bijal)
  • From: Michael Behrisch <oss@xxxxxxxxxxx>
  • Date: Fri, 29 Mar 2019 21:38:04 +0100
  • Autocrypt: addr=oss@xxxxxxxxxxx; prefer-encrypt=mutual; keydata= mQGiBFLSvucRBACGsasS4GeIWs1CFNTOYmp3ScQ2ZTJLJWQxhPliwtHTzLsErYu9Y7e8qDov iHFviYyaNuceUNoACm1e4MT4eu0DmM2Wk3y/jjD6hfm7L0EZNPxQhj+CJf2oZAm2ezCe7/si xZ2d7TCO8yWavOGbF0EVi/ZDIJqVgupu6WBpv/NCewCg65HQiS1wm+1w1MdFYxKCmXzbv08D /iWXX3tzabbCrLlUum8hBgBpJEHRtlic2uaGsKm8Fize4tfLZkTBbTYLYXfcx2Oq9+lINPTW h9jnbCjAjErRWLTjNTQjel0JnDryCnqabub/R3wScR/EHRDBeS9L6YRj0xdVd2qIaArtSYRR auKPNc4M2qZNEFSM37cXC7avhpdeA/99oJf4qyVly4RxHmekAmj9UJjRx17x9xX8t9uzUuSt AeTh+kQ3o5jK7veU6/F/+pPyi96EOzym9BJA8pgXC8hLWNjOajI10filkdQ26QsfHOpUdPSZ 4Duyw9Ayj8loagEnnAONmU/xE0QlyVBANIut0W+SNqPScYXfnBbVOaG3HbQiTWljaGFlbCBC ZWhyaXNjaCA8b3NzQGJlaHJpc2NoLmRlPohjBBMRAgAjBQJS0sHSAhsjBwsJCAcDAgEGFQgC CQoLBBYCAwECHgECF4AACgkQPBD+ltFwpimlmQCdGgnYuHxoye4vFntyHRcE0Ij0318AoN3s szGyKcKdUmPpgXLhFcNfRGe4uQENBFLSvucQBACRAt3OW7eL8N3OJp2bZz/rRldtxjcViEcd +wpQcL9Ag0b6W7e4cbSc9oSU9MAdOvxR0UxualeRGz37W/VEC8cFZb3kFtRdl66gGygKb7gl 2S27495XEYqE7BBF1HfQDjL9sh5GfuIzORkqhCHSUTdkRuzRPxNQcEYFSrASEi9jQwADBQP9 FeuTC1SJHrX9tP3p4xrEa07XkCq+UzwNhDdezoQfT1CUbOv+LT66yLTXAaiHXelgaPMQO1Oo 76U2z0C1LudkAcDdwJbMuZ0RfDoRjsgfhfvM6kqiP4m0s2NR3Y3O+HKXjwtPbXuDwaYIAIvp aj8b59n7fQyfL6BZsO0QZc0i/t+ISQQYEQIACQUCUtK+5wIbDAAKCRA8EP6W0XCmKY1lAKCc 3miJueOXuvZJWV7qGBQxxyR83gCgxhGPL9OrP22rxNJSo1w5OOUxHsM=
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/sumo-user>
  • List-help: <mailto:sumo-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=unsubscribe>
  • Openpgp: preference=signencrypt
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

Hi,
just retrieve the node from the network (getNode), then iterate over the
outgoing edges (getOutgoing) and take the one which has the next node as
endpoint.

Best regards,
Michael

Am 29.03.19 um 13:29 schrieb Bijal:
> Dear Sir,
> 
> Now adjacency matrix filled fine and ACO ALGORITHM works nicely.
> 
> I am getting list of vertexes, Traversed by ant in shortest way : 
> 
> Like [0,1,3,4,5,7,8,9,6,2]
> 
> Issue : I can get from and to field to build edge using this vertex.
> 
> But to create a route I need following :
> <Edge Id= from= to=>
> 
> Is there anyway to get edge ID to build a route out of this vertex list?
> 
> 
> 
> On Wed 27 Mar, 2019, 5:22 PM , <sumo-user-request@xxxxxxxxxxx
> <mailto:sumo-user-request@xxxxxxxxxxx>> wrote:
> 
>     Send sumo-user mailing list submissions to
>             sumo-user@xxxxxxxxxxx <mailto:sumo-user@xxxxxxxxxxx>
> 
>     To subscribe or unsubscribe via the World Wide Web, visit
>             https://www.eclipse.org/mailman/listinfo/sumo-user
>     or, via email, send a message with subject or body 'help' to
>             sumo-user-request@xxxxxxxxxxx
>     <mailto:sumo-user-request@xxxxxxxxxxx>
> 
>     You can reach the person managing the list at
>             sumo-user-owner@xxxxxxxxxxx <mailto:sumo-user-owner@xxxxxxxxxxx>
> 
>     When replying, please edit your Subject line so it is more specific
>     than "Re: Contents of sumo-user digest..."
> 
> 
>     Today's Topics:
> 
>        1. Re: Traffic Light (iCashWave)
>        2. Re: Traffic Light (Jakob Erdmann)
>        3. Re: Convert sumolib.net.readnet Graph to Adjacency       
>     Matrix (Bijal)
> 
> 
>     ----------------------------------------------------------------------
> 
>     Message: 1
>     Date: Wed, 27 Mar 2019 18:24:50 +0800
>     From: iCashWave <icashwave@xxxxxxxxx <mailto:icashwave@xxxxxxxxx>>
>     To: Sumo project User discussions <sumo-user@xxxxxxxxxxx
>     <mailto:sumo-user@xxxxxxxxxxx>>
>     Subject: Re: [sumo-user] Traffic Light
>     Message-ID:
>            
>     <CAAUjJ+U+XCxi9Uy_BuKw+wG9c_Q2w5xOy-rjF7Gg+pUCJf1H2g@xxxxxxxxxxxxxx
>     <mailto:CAAUjJ%2BU%2BXCxi9Uy_BuKw%2BwG9c_Q2w5xOy-rjF7Gg%2BpUCJf1H2g@xxxxxxxxxxxxxx>>
>     Content-Type: text/plain; charset="utf-8"
> 
>     Hi,
>     You should change the light phase,such as chaning G to r.
> 
>     Cellen Fadi <mariacellen@xxxxxxxxxxx
>     <mailto:mariacellen@xxxxxxxxxxx>> ? 2019?3?27? ?? 18:04???
> 
>     > hello,
>     >
>     > I would like to change the priority rule at the traffic lights.
>     Like you
>     > see on the picture the green and red phases are wrong . I have
>     tried to
>     > select conflict in NETEDIT but it does not work. Can you help me
>     please.
>     > Thanks!
>     >
>     > best regards
>     > Fadi
>     > _______________________________________________
>     > sumo-user mailing list
>     > sumo-user@xxxxxxxxxxx <mailto:sumo-user@xxxxxxxxxxx>
>     > To change your delivery options, retrieve your password, or
>     unsubscribe
>     > from this list, visit
>     > https://www.eclipse.org/mailman/listinfo/sumo-user
>     >
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL:
>     <https://www.eclipse.org/mailman/private/sumo-user/attachments/20190327/c873add7/attachment.html>
> 
>     ------------------------------
> 
>     Message: 2
>     Date: Wed, 27 Mar 2019 12:14:33 +0100
>     From: Jakob Erdmann <namdre.sumo@xxxxxxxxx
>     <mailto:namdre.sumo@xxxxxxxxx>>
>     To: Sumo project User discussions <sumo-user@xxxxxxxxxxx
>     <mailto:sumo-user@xxxxxxxxxxx>>
>     Subject: Re: [sumo-user] Traffic Light
>     Message-ID:
>            
>     <CAMbUcby6kWu0n_oRnhDmRV+1s2CdLBhaBj4zFx0EJ0z7VtVu7A@xxxxxxxxxxxxxx
>     <mailto:CAMbUcby6kWu0n_oRnhDmRV%2B1s2CdLBhaBj4zFx0EJ0z7VtVu7A@xxxxxxxxxxxxxx>>
>     Content-Type: text/plain; charset="utf-8"
> 
>     You must use the traffic light mode of netedit (hotkey 't') to edit
>     traffic
>     light plans.
> 
>     Am Mi., 27. M?rz 2019 um 11:25 Uhr schrieb iCashWave
>     <icashwave@xxxxxxxxx <mailto:icashwave@xxxxxxxxx>>:
> 
>     > Hi,
>     > You should change the light phase,such as chaning G to r.
>     >
>     > Cellen Fadi <mariacellen@xxxxxxxxxxx
>     <mailto:mariacellen@xxxxxxxxxxx>> ? 2019?3?27? ?? 18:04???
>     >
>     >> hello,
>     >>
>     >> I would like to change the priority rule at the traffic lights.
>     Like you
>     >> see on the picture the green and red phases are wrong . I have
>     tried to
>     >> select conflict in NETEDIT but it does not work. Can you help me
>     please.
>     >> Thanks!
>     >>
>     >> best regards
>     >> Fadi
>     >> _______________________________________________
>     >> sumo-user mailing list
>     >> sumo-user@xxxxxxxxxxx <mailto:sumo-user@xxxxxxxxxxx>
>     >> To change your delivery options, retrieve your password, or
>     unsubscribe
>     >> from this list, visit
>     >> https://www.eclipse.org/mailman/listinfo/sumo-user
>     >>
>     > _______________________________________________
>     > sumo-user mailing list
>     > sumo-user@xxxxxxxxxxx <mailto:sumo-user@xxxxxxxxxxx>
>     > To change your delivery options, retrieve your password, or
>     unsubscribe
>     > from this list, visit
>     > https://www.eclipse.org/mailman/listinfo/sumo-user
>     >
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL:
>     <https://www.eclipse.org/mailman/private/sumo-user/attachments/20190327/65e25d65/attachment.html>
> 
>     ------------------------------
> 
>     Message: 3
>     Date: Wed, 27 Mar 2019 17:25:13 +0800
>     From: Bijal <bijal.varia88@xxxxxxxxx <mailto:bijal.varia88@xxxxxxxxx>>
>     To: Sumo project User discussions <sumo-user@xxxxxxxxxxx
>     <mailto:sumo-user@xxxxxxxxxxx>>
>     Subject: Re: [sumo-user] Convert sumolib.net.readnet Graph to
>             Adjacency       Matrix
>     Message-ID:
>            
>     <CABbss+jjh3_UpsNGvaRc6Fmic8GWdmVE-T4ucWz2rBpzGoMWSQ@xxxxxxxxxxxxxx
>     <mailto:CABbss%2Bjjh3_UpsNGvaRc6Fmic8GWdmVE-T4ucWz2rBpzGoMWSQ@xxxxxxxxxxxxxx>>
>     Content-Type: text/plain; charset="utf-8"
> 
>     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: image.png]
> 
> 
>     -- 
>     *:)*
>     Bijal Varia
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL:
>     <https://www.eclipse.org/mailman/private/sumo-user/attachments/20190327/b8ea9bf3/attachment.html>
>     -------------- next part --------------
>     A non-text attachment was scrubbed...
>     Name: image.png
>     Type: image/png
>     Size: 248841 bytes
>     Desc: not available
>     URL:
>     <https://www.eclipse.org/mailman/private/sumo-user/attachments/20190327/b8ea9bf3/attachment.png>
> 
>     ------------------------------
> 
>     _______________________________________________
>     sumo-user mailing list
>     sumo-user@xxxxxxxxxxx <mailto:sumo-user@xxxxxxxxxxx>
>     To change your delivery options, retrieve your password, or
>     unsubscribe from this list, visit
>     https://www.eclipse.org/mailman/listinfo/sumo-user
> 
> 
>     End of sumo-user Digest, Vol 21, Issue 106
>     ******************************************
> 
> 
> _______________________________________________
> sumo-user mailing list
> sumo-user@xxxxxxxxxxx
> 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


Back to the top