Hi Dillip,

in your try/except construct you should print the exception, here are my proposed changes

harald@nyc> diff -C1 -b demo-i*
*** demo-i_hs.py        2020-07-07 07:50:42.456722800 +0200
--- demo-i.py   2020-07-06 14:24:24.000000000 +0200
***************
*** 8,11 ****
  import json  #for writing dumps and combining stuffs
- import traceback
-
  #import StringIO
--- 8,9 ----
***************
*** 299,304 ****
          run()
!     except Exception as e:
!       traceback.print_exc()
!       print(str(e))
!       print ("Unexpected error:", sys.exc_info()[0])
        print("TraCI program is unable to start the simulation")
--- 297,299 ----
          run()
!     except:
          print("TraCI program is unable to start the simulation")
***************
*** 313 ****
--- 308,309 ----
      main()
+

The result is:

Error in Previous Stage retrieval, so, skip this personID:  2229
Traceback (most recent call last):
  File "./demo-i_hs.py", line 299, in main
    run()
  File "./demo-i_hs.py", line 84, in run
    currStage = traci.person.getStage(peopleIDs[i])
  File "/usr/local/lib/python3.8/dist-packages/traci/_person.py", line 159, in getStage
    return self._getUniversal(tc.VAR_STAGE, personID, "i", nextStageIndex)
  File "/usr/local/lib/python3.8/dist-packages/traci/domain.py", line 167, in _getUniversal     return _parse(self._retValFunc, varID, self._getCmd(varID, objectID, format, *values))   File "/usr/local/lib/python3.8/dist-packages/traci/domain.py", line 172, in _getCmd     r = self._connection._sendCmd(self._cmdGetID, varID, objID, format, *values)   File "/usr/local/lib/python3.8/dist-packages/traci/connection.py", line 178, in _sendCmd
    return self._sendExact()
  File "/usr/local/lib/python3.8/dist-packages/traci/connection.py", line 83, in _sendExact
    self._socket.send(length + self._string)
AttributeError: 'Connection' object has no attribute '_socket'
'Connection' object has no attribute '_socket'
Unexpected error: <class 'AttributeError'>
TraCI program is unable to start the simulation

Don't asked my, what to do to fix this

Greetings, Harald

Am 07.07.20 um 06:41 schrieb Tripplanner Mumbai:
Hello Harald,
I am extremely sorry to miss that file.
I am sending the revised network example, please go through it.
thanks and regards,
Dillip Rout

On Tue, 7 Jul 2020 at 00:16, Harald Schaefer <[email protected] <mailto:[email protected]>> wrote:

    Hi Dillip,

    there is no settings.gui.xml in your example

    harald@nyc> demo-i.py --nogui
    TraCI program is unable to load the network
     Retrying in 1 seconds
    Loading configuration ... done.
    Error: File 'settings.gui.xml' is not accessible (No such file or
    directory).

    Greetings, Harald

    Am 06.07.20 um 11:13 schrieb Tripplanner Mumbai:
    Hello Jakob,
    As discussed earlier, I installed a newer version and tried my
    TraCI program once again. Basically, I was trying to retrieve the
    previous stage stop results, particularly as follows:
    /          print("previous
    stage","type",prevStage.type,"dest",prevStage.destStop,"travel
    time", prevStage.travelTime, "distance",prevStage.length,"depart 
    time", prevStage.depart)/
    /
    /
    Surprisingly,//I got some exceptions now which were not there in
    the previous versions. In particular I am getting the following
    error:
    /Error in Previous Stage retrieval, so, skip this personID:  2229/
    /         , which is due to line number 97 in my TraCI program./

    I am attaching my network again, it contains the same TraCI
    program (demo-i.py) that I mentioned above. Ideally, it should be
    able to retrieve the previous stage information for a person who
    has already boarded or completed a trip by public transport.
    According to my scenario every person walks to the bus stop prior
    to boarding any bus.

    Please investigate further about the inconsistencies.

    thanks and regards,
    Dillip Rout

    On Fri, 3 Jul 2020 at 14:24, Tripplanner Mumbai
    <[email protected] <mailto:[email protected]>> wrote:

        Hello,
        Oh I see, thankfully, you have fixed the issue.
        thanks and regards,
        Dillip Rout

        On Fri, 3 Jul 2020 at 13:48, Jakob Erdmann
        <[email protected] <mailto:[email protected]>> wrote:

            Hello,
            that information was previously missing from the stage
            output (https://github.com/eclipse/sumo/issues/7274).
            You can download the updated version tomorrow at
            
https://sumo.dlr.de/docs/Downloads.php#sumo_-_latest_development_version
            regards,
            Jakob

            Am Di., 30. Juni 2020 um 09:56 Uhr schrieb Tripplanner
            Mumbai <[email protected]
            <mailto:[email protected]>>:

                Hello Jakob,
                My apologies for misinterpreting your statements,
                thanks for your clarification. Yes, the analysis is
                true there are multiple persons with single or double
                riding.

                Now, I am trying to extract the trip information
                using TraCI, but not successful right now. In
                Particular, I was trying to extract the following
                information from the previous stage.

                /         print("previous
                stage","type",prevStage.type,"dest",prevStage.destStop,"travel
                time", prevStage.travelTime,
                "distance",prevStage.length,"depart time",
                prevStage.depart)/

                Unfortunately, the output does not contain all the
                required information, as shown below.
                /previous stage type 3 dest busStop#12 travel time
                -1.0 distance 672.437702712895 depart time -0.001/
                As seen, travel time and depart time are negative, it
                is hard to interpret. I guess the distance shown is
                the distance of the ride covered in previous stage of
                the person. Further, depart time is a must field for
                my objective.

                Could you please provide some insights so that I can
                get the values of all fields of previous stage?

                thanks and regards,
                Dillip Rout




                On Tue, 30 Jun 2020 at 12:21, Jakob Erdmann
                <[email protected]
                <mailto:[email protected]>> wrote:

                    I never claimed that trip-output == stop-output -
                    running, only that persons still running are
                    responsible for trip-output != stop-output.
                    This is because a person that is still in the
                    simulation may have previously taken any number
                    of rides and all of those are missing from the
                    trip-output.

                    As the result of
                    sumo/tools/route/analyzePersonPlans.py -r
                    persontrips.rou.xml shows, there are a number of
                    persons with multiple rides:

                    Loaded 9000 persons
                       1: walk public public walk public walk
                      31: walk public walk public walk
                      75: walk public public walk
                    2154: walk public walk
                    6739: walk


                    Am Di., 30. Juni 2020 um 08:01 Uhr schrieb
                    Tripplanner Mumbai <[email protected]
                    <mailto:[email protected]>>:

                        Hello,
                        I ran it again using the TraCI program and
                        the log says the following.
                                   Persons: [Inserted: 9000, Running:
                        28, Jammed: 167]
                        Possibly, you are pointing out to Running: 28
                        which is the discrepancy.

                        Furthermore, I share the following counts of
                        rides got from the execution:
                                  2334 trip-output
                                  2341 stop-output
                                  2341 TraCI program log

                        Clearly, the ride statistics from the
                        simulation matches the trip-output count:
                                  Ride Statistics (avg of 2334
                        rides): [WaitingTime: 205.01, RouteLength:
                        505.21, Duration: 100.75, Bus: 2334]

                        However, the ride count is note balanced as
                        per your recommendation, i.e., *trip-output
                        == stop-output - running*. On the other hand,
                        stop-output == TraCI count, which is only
                        about the completed rides (not the entire trips).
                        Looks like I have to extract some more
                        information from TraCI to get the desired
                        result. Meanwhile, if you have some more
                        clarification and suggestions, please let me
                        know.

                        thanks and regards,
                        Dillip Rout

                        On Mon, 29 Jun 2020 at 17:54, Jakob Erdmann
                        <[email protected]
                        <mailto:[email protected]>> wrote:

                            When I run your simulation (run.sumocfg),
                            I get 2341 loaded/unloaded persons in
                            stop-output.
                            I used attributeStats.py -e stopinfo -a
                            loadedPersons stops-out.xml -p 5
                            and this gives 622 stops with an average
                            of  3.76367 loaded/unloaded

                            At the end time of 36000 there are still
                            28 persons in the simulation according to
                            the log.
                            You can also check this by comparing the
                            input count (9000 persons) to the
                            tripinfo output count (8972 persons).

                            Looking at the simulation reveals that
                            these persons are waiting at a busStop
                            after all buses have already left. Some
                            of them such as person 6064 have already
                            used a bus by that time which creates a
                            discrepancy between loadedPersons and
                            ride count in tripinfo-output.

                            The pedestrian collisions are (among
                            other things) caused by vehicles that
                            drive on the sidewalks due to being
                            configured with vClass="ignoring".
                            The pedestrian jamming (which could be
                            caused by mis-dimensioned
                            sidewalks/crossings) could be responsible
                            for persons missing their buses.

                            regards,
                            Jakob




                            Am Mo., 29. Juni 2020 um 10:21 Uhr
                            schrieb Tripplanner Mumbai
                            <[email protected]
                            <mailto:[email protected]>>:

                                Hello,
                                *"tripinfo-output only contains
                                persons that have completed their
                                whole itinerary (all walks and rides)"*
                                The above may be true, but your later
                                statements explain the issues
                                partially. I changed the time from
                                3600 to 36000, and also, restored the
                                bus route input file. However, I
                                still find that stop-output contains
                                2318 boarding and alighting, whereas
                                trip-output contains 2310 trips for
                                passengers. I suspected that maybe
                                those 8 passengers are stuck in jams
                                and/or collisions. To my surprise, I
                                found that the number of jams and
                                collisions are certainly more than 8
                                (at least 5 times of it). Then, what
                                is the reason for having such a gap
                                between stop-output count and
                                trip-output count.

                                When I ran the same simulation using
                                TraCI, I found that total trips on
                                buses 2341.

                                I am attaching the latest network
                                which I used for simulation in the
                                command line as well as in TraCI.
                                Please recheck, there might be some
                                issues in the software itself ( I am
                                using a version which was updated on
                                June 25, 2020).
                                **

                                On Mon, 29 Jun 2020 at 11:52, Jakob
                                Erdmann <[email protected]
                                <mailto:[email protected]>> wrote:

                                    tripinfo-output only contains
                                    persons that have completed their
                                    whole itinerary (all walks and
                                    rides). Since your configuration
                                    ends the simulation at step 3600
                                    it will prevent output of all
                                    persons still travelling at that
                                    time even though they already
                                    rode a bus and thus show up in
                                    the stop-output.

                                    Am Fr., 26. Juni 2020 um
                                    10:35 Uhr schrieb Tripplanner
                                    Mumbai <[email protected]
                                    <mailto:[email protected]>>:

                                        Hello,
                                        Again, I tried this with the
                                        latest development version of
                                        SUMO which was updated on
                                        June 25, 2020. However, the
                                        same issue continues, /i.e./,
                                        the number of boarded and
                                        alighted persons in stop
                                        output is more than the
                                        number of records in trip output.
                                        Kindly, look into it at earliest.
                                        thanks and regards,
                                        Dillip Rout

                                        On Wed, 24 Jun 2020 at 17:20,
                                        Tripplanner Mumbai
                                        <[email protected]
                                        <mailto:[email protected]>>
                                        wrote:

                                            Hello,
                                            Recently, I implemented
                                            public transit lines in
                                            SUMO. I encountered that
                                            the number of passengers
                                            boarded at a stop
                                            according to stop output,
                                            does not  match with the
                                            number of passengers
                                            making successful trips
                                            according to trip output.
                                            I was assuming that every
                                            passenger who boards into
                                            some bus at any stop has
                                            an entry in trip output
                                            as well. I tried with
                                            TraCI as well as a simple
                                            command line, but in
                                            either case, I found that
                                            the passenger count
                                            varies. Typically, the
                                            total number passengers
                                            boarded (as per stop
                                            output) is greater than
                                            the total number of
                                            passengers in the trip
                                            output. However, when I
                                            extracted additional data
                                            through TraCI, then I
                                            found that the number of
                                            passengers at various
                                            stops as per stop output
                                            is the same as the
                                            extracted information
                                            about each passenger
                                            through TraCI.

                                            I am attaching my network
                                            along with TraCI code
                                            (demo-i.py) to be tested
                                            by others. Also, I am
                                            attaching a few csv files
                                            which I have extracted
                                            from the xml output files
                                            for easier reference.

                                            Please clarify if the
                                            stop output count of
                                            passengers has to be the
                                            same as the number of
                                            trips as per trip output
                                            or not.

                                            thanks and regards,
                                            Dillip Rout

                                        
_______________________________________________
                                        sumo-user mailing list
                                        [email protected]
                                        <mailto:[email protected]>
                                        To unsubscribe from this
                                        list, visit
                                        
https://www.eclipse.org/mailman/listinfo/sumo-user

                                    
_______________________________________________
                                    sumo-user mailing list
                                    [email protected]
                                    <mailto:[email protected]>
                                    To unsubscribe from this list,
                                    visit
                                    
https://www.eclipse.org/mailman/listinfo/sumo-user

                                _______________________________________________
                                sumo-user mailing list
                                [email protected]
                                <mailto:[email protected]>
                                To unsubscribe from this list, visit
                                
https://www.eclipse.org/mailman/listinfo/sumo-user

                            _______________________________________________
                            sumo-user mailing list
                            [email protected]
                            <mailto:[email protected]>
                            To unsubscribe from this list, visit
                            https://www.eclipse.org/mailman/listinfo/sumo-user

                        _______________________________________________
                        sumo-user mailing list
                        [email protected]
                        <mailto:[email protected]>
                        To unsubscribe from this list, visit
                        https://www.eclipse.org/mailman/listinfo/sumo-user

                    _______________________________________________
                    sumo-user mailing list
                    [email protected] <mailto:[email protected]>
                    To unsubscribe from this list, visit
                    https://www.eclipse.org/mailman/listinfo/sumo-user

                _______________________________________________
                sumo-user mailing list
                [email protected] <mailto:[email protected]>
                To unsubscribe from this list, visit
                https://www.eclipse.org/mailman/listinfo/sumo-user

            _______________________________________________
            sumo-user mailing list
            [email protected] <mailto:[email protected]>
            To unsubscribe from this list, visit
            https://www.eclipse.org/mailman/listinfo/sumo-user


    _______________________________________________
    sumo-user mailing list
    [email protected]  <mailto:[email protected]>
    To unsubscribe from this list, 
visithttps://www.eclipse.org/mailman/listinfo/sumo-user
    _______________________________________________
    sumo-user mailing list
    [email protected] <mailto:[email protected]>
    To unsubscribe from this list, visit
    https://www.eclipse.org/mailman/listinfo/sumo-user


_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to