Dear Titus.
Since the command traci.trafficlights.getCompleteRedYellowGreenDefinition
returns a cell array containing all the programs associated to the traffic
lights, you have to add a subscript to existingTrafficSignal, as follows:
existingTrafficSignal =
traci.trafficlights.getCompleteRedYellowGreenDefinition('1307347941');
if no > 0
%some logic here
else
traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941',existingTrafficSignal{1});
end
The same holds for the Python implementation, with a list instead of a cell
array.
Best Regards!!
2014-07-20 22:38 GMT-05:00 <[email protected]>:
> Send sumo-user mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/sumo-user
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of sumo-user digest..."
>
>
> Today's Topics:
>
> 1. inconsistent code in
> microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp
> (Michele Covell)
> 2. Re: Fwd: Controlling traffic lights through TraCI
> (marie stephanie Nitemzem)
> 3. Converting static traffic logic to TRACI command. (Titus Rakkesh)
> 4. MatLab TraCI Issue - Pls assist (Titus Rakkesh)
> 5. Re: MatLab TraCI Issue - Pls assist (Thomas Lockhart)
> 6. Re: MatLab TraCI Issue - Pls assist (Titus Rakkesh)
> 7. Re: MatLab TraCI Issue - Pls assist (Thomas Lockhart)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 16 Jul 2014 17:01:09 -0700
> From: Michele Covell <[email protected]>
> Subject: [sumo-user] inconsistent code in
> microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp
> To: [email protected]
> Message-ID:
> <
> canmkwpyuhn0fh7lqf8adk7kxcokuqpim2z0ygqe0vytwnqu...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> After spending a reasonable amount of time looking at this part of the code
> base, I think there are two bugs:
> (1) The parameters myMaxGap, myPassingTime, MyDetectorGap, all need to get
> multiplied by DELTA_T (so that they are in the right units for the way they
> are used)
> (2) In MSActuatedTrafficLightLogic::duration(): The way that newduration
> is set/used is not internally consistent (and, for one piece, not
> consistent with the way the return value is being used outside of this
> routine. newduration should be the desired extension to the current light
> phase duration. That means that it should not be set to minDuration (line
> 145) but instead set to DELTA_T and it should not be limited by maxDuration
> (line 162) but instead should be limited by the difference between
> maxDuration and the current duration.
>
> Please let me know if I am misunderstanding this code. My simulations with
> actuated traffic lights are better behaved when I make these changes (but
> it is not that either way causes a complete breakdown in operation).
>
> Thanks, Michele
>
> (I'd submit this as a ticket but I seem to be having trouble getting access
> to the ticket system....)
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 18 Jul 2014 18:04:08 +0200
> From: marie stephanie Nitemzem <[email protected]>
> Subject: Re: [sumo-user] Fwd: Controlling traffic lights through TraCI
> To: sumo-user <[email protected]>
> Message-ID:
> <CAPbEwg_HXA1viF=nun=e57h2XZZfYoM_eYPR1rK=
> [email protected]>
> Content-Type: text/plain; charset=UTF-8
>
> Hi everybody,
>
> i was wondering how come the HBEFA v3.1-based
> <http://sumo-sim.org/userdoc/Models/Emissions/HBEFA-based.html> emission
> model is no more available on sumo-sim.org?
>
> Thanks
>
>
> 2014-07-15 8:39 GMT+02:00 Jakob Erdmann <[email protected]>:
>
> > Please take a look at
> > http://sumo-sim.org/wiki/Tutorials/TraCI4Traffic_Lights which does
> exactly
> > this.
> > regards,
> > Jakob
> >
> >
> > 2014-07-15 6:47 GMT+02:00 Titus Rakkesh <[email protected]>:
> >
> > > ---------- Forwarded message ----------
> > > From: Titus Rakkesh <[email protected]>
> > > Date: Sun, Jul 13, 2014 at 11:56 PM
> > > Subject: Controlling traffic lights through TraCI
> > > To: sumo-user <[email protected]>
> > >
> > >
> > > Dear All,
> > > Currently I am using MatLab TraCI for a simulation purpose. I have
> > > attached an image for your reference. Here I want to control the
> > mentioned
> > > traffic lights from TraCI. I have put 2 induction loop detectors. If a
> > > vehicle pass the induction loop, I want to change the light to green
> and
> > > allow green for some time. Then change back to yellow and red and keep.
> > Pls
> > > assist me how I can do with sample code segment.
> > >
> > > Thanks,
> > > Titus.
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------------
> > > Want fast and easy access to all the code in your enterprise? Index and
> > > search up to 200,000 lines of code with a free copy of Black Duck
> > > Code Sight - the same software that powers the world's largest code
> > > search on Ohloh, the Black Duck Open Hub! Try it now.
> > > http://p.sf.net/sfu/bds
> > > _______________________________________________
> > > sumo-user mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/sumo-user
> > >
> > >
> >
> >
> ------------------------------------------------------------------------------
> > Want fast and easy access to all the code in your enterprise? Index and
> > search up to 200,000 lines of code with a free copy of Black Duck
> > Code Sight - the same software that powers the world's largest code
> > search on Ohloh, the Black Duck Open Hub! Try it now.
> > http://p.sf.net/sfu/bds
> > _______________________________________________
> > sumo-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/sumo-user
> >
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 19 Jul 2014 12:46:06 +0530
> From: Titus Rakkesh <[email protected]>
> Subject: [sumo-user] Converting static traffic logic to TRACI command.
> To: sumo-user <[email protected]>
> Message-ID:
> <
> cabm7v63g72ze_h6t68xuhvfjahw-kznazov9uakorkueevu...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hi Friends,
> Currently I am having the following static traffic light configuration
> in a file. I want to convert the same behaviour to TraCI commands,
>
>
> <tlLogic id="1307347941" type="static" programID="0" offset="0">
> <phase duration="31" state="GGrr"/>
> <phase duration="9" state="yyrr"/>
> <phase duration="31" state="rrGG"/>
> <phase duration="9" state="rryy"/>
> </tlLogic>
>
> How I can do this?
>
> I tried something lke this,
>
> myRYGDefinition = traci.trafficlights.Logic('1307347941',0,0,0,...
> {traci.trafficlights.Phase(3100,3100,3100,'GGrr'),...
> traci.trafficlights.Phase(900,900,900,'yyrr'),...
> traci.trafficlights.Phase(3100,3100,3100,'rrGG'),...
> traci.trafficlights.Phase(900,900,900,'rryy')});
>
>
> traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941',myRYGDefinition);
>
> But it is giving totally different behaviour. How I can do this? Pls
> assist,
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 21 Jul 2014 00:09:09 +0530
> From: Titus Rakkesh <[email protected]>
> Subject: [sumo-user] MatLab TraCI Issue - Pls assist
> To: sumo-user <[email protected]>
> Message-ID:
> <CABm7V63HQmwAb38ktK7zXPJ86-1dzdovVg9Hq36e5PbZ=
> [email protected]>
> Content-Type: text/plain; charset=UTF-8
>
> Dears,
> I am having a code segement as,
>
> existingTrafficSignal =
> traci.trafficlights.getCompleteRedYellowGreenDefinition('1307347941');
>
> if no > 0
> %some logic here
> else
>
>
> traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941','existingTrafficSignal');
> end
>
>
> But when running at "
>
> traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941','existingTrafficSignal');"
> error coming as,
>
>
> Attempt to reference field of non-structure array.
>
> Error in traci.trafficlights.setCompleteRedYellowGreenDefinition (line 15)
> len = 1+4 + 1+4+length(tls.subID) + 1+4 + 1+4 + 1+4 + 1+4; % tls parameter
>
> Error in UCSC_Modified_Traffic (line 50)
>
>
> traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941',existingTrafficSignal);
>
> Pls assist how we can sort this out.
>
> Thanks,
> Rakkesh
>
>
> ------------------------------
>
> Message: 5
> Date: Sun, 20 Jul 2014 15:27:11 -0700
> From: Thomas Lockhart <[email protected]>
> Subject: Re: [sumo-user] MatLab TraCI Issue - Pls assist
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 7/20/14 11:39 AM, Titus Rakkesh wrote:
> > Dears,
> > I am having a code segement as,
> >
> > existingTrafficSignal =
> > traci.trafficlights.getCompleteRedYellowGreenDefinition('1307347941');
> >
> > if no > 0
> > %some logic here
> > else
> >
> >
> traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941','existingTrafficSignal');
> > end
> >
> Take "existingTrafficSignal" out of quotes in the call to
> setCompleteRedYellowGreenDefinition(). It needs to be passed as a
> variable (which you have already set in your call to
> getCompleteRedYellowGreenDefinition()), not as a string.
>
> hth
>
> - Tom
>
>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 21 Jul 2014 08:14:26 +0530
> From: Titus Rakkesh <[email protected]>
> Subject: Re: [sumo-user] MatLab TraCI Issue - Pls assist
> To: Thomas Lockhart <[email protected]>
> Cc: sumo-user <[email protected]>
> Message-ID:
> <
> cabm7v62dem_otpshjq-v6h2elzddo5skyrrdc1vq00dtzn3...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I tried by removing qutoes and trying,
>
> traci.trafficlights.
> setCompleteRedYellowGreenDefinition('1307347941',existingTrafficSignal);
>
> But I get the same error as,
>
> Attempt to reference field of non-structure array.
>
> Error in traci.trafficlights.
> setCompleteRedYellowGreenDefinition (line 15)
> len = 1+4 + 1+4+length(tls.subID) + 1+4 + 1+4 + 1+4 + 1+4; % tls parameter
>
> Error in UCSC_Modified_Traffic (line 50)
>
>
> traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941',existingTrafficSignal);
>
>
>
>
> On Mon, Jul 21, 2014 at 3:57 AM, Thomas Lockhart <
> [email protected]> wrote:
>
> > On 7/20/14 11:39 AM, Titus Rakkesh wrote:
> > > Dears,
> > > I am having a code segement as,
> > >
> > > existingTrafficSignal =
> > > traci.trafficlights.getCompleteRedYellowGreenDefinition('1307347941');
> > >
> > > if no > 0
> > > %some logic here
> > > else
> > >
> > >
> >
> traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941','existingTrafficSignal');
> > > end
> > >
> > Take "existingTrafficSignal" out of quotes in the call to
> > setCompleteRedYellowGreenDefinition(). It needs to be passed as a
> > variable (which you have already set in your call to
> > getCompleteRedYellowGreenDefinition()), not as a string.
> >
> > hth
> >
> > - Tom
> >
> >
> >
> ------------------------------------------------------------------------------
> > Want fast and easy access to all the code in your enterprise? Index and
> > search up to 200,000 lines of code with a free copy of Black Duck
> > Code Sight - the same software that powers the world's largest code
> > search on Ohloh, the Black Duck Open Hub! Try it now.
> > http://p.sf.net/sfu/bds
> > _______________________________________________
> > sumo-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/sumo-user
> >
>
>
> ------------------------------
>
> Message: 7
> Date: Sun, 20 Jul 2014 20:38:36 -0700
> From: Thomas Lockhart <[email protected]>
> Subject: Re: [sumo-user] MatLab TraCI Issue - Pls assist
> To: Titus Rakkesh <[email protected]>
> Cc: sumo-user <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> On 7/20/14 7:44 PM, Titus Rakkesh wrote:
> > I tried by removing qutoes and trying,
> >
> > traci.trafficlights.
> > setCompleteRedYellowGreenDefinition('1307347941',existingTrafficSignal);
> >
> > But I get the same error as,
> >
> > Attempt to reference field of non-structure array.
> I'm afraid I don't know anything about the matlab interface, but was
> referencing the python interface. Hopefully someone will be able to give
> useful advice...
>
> - Tom
>
> >
> > Error in traci.trafficlights.
> > setCompleteRedYellowGreenDefinition (line 15)
> > len = 1+4 + 1+4+length(tls.subID) + 1+4 + 1+4 + 1+4 + 1+4; % tls
> parameter
> >
> > Error in UCSC_Modified_Traffic (line 50)
> >
> traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941',existingTrafficSignal);
> >
> >
> >
> >
> > On Mon, Jul 21, 2014 at 3:57 AM, Thomas Lockhart
> > <[email protected] <mailto:[email protected]>>
> > wrote:
> >
> > On 7/20/14 11:39 AM, Titus Rakkesh wrote:
> > > Dears,
> > > I am having a code segement as,
> > >
> > > existingTrafficSignal =
> > >
> >
> traci.trafficlights.getCompleteRedYellowGreenDefinition('1307347941');
> > >
> > > if no > 0
> > > %some logic here
> > > else
> > >
> > >
> >
> traci.trafficlights.setCompleteRedYellowGreenDefinition('1307347941','existingTrafficSignal');
> > > end
> > >
> > Take "existingTrafficSignal" out of quotes in the call to
> > setCompleteRedYellowGreenDefinition(). It needs to be passed as a
> > variable (which you have already set in your call to
> > getCompleteRedYellowGreenDefinition()), not as a string.
> >
> > hth
> >
> > - Tom
> >
> >
> ------------------------------------------------------------------------------
> > Want fast and easy access to all the code in your enterprise?
> > Index and
> > search up to 200,000 lines of code with a free copy of Black Duck
> > Code Sight - the same software that powers the world's largest code
> > search on Ohloh, the Black Duck Open Hub! Try it now.
> > http://p.sf.net/sfu/bds
> > _______________________________________________
> > sumo-user mailing list
> > [email protected]
> > <mailto:[email protected]>
> > https://lists.sourceforge.net/lists/listinfo/sumo-user
> >
> >
>
>
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
>
> ------------------------------
>
> _______________________________________________
> sumo-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sumo-user
>
>
> End of sumo-user Digest, Vol 96, Issue 12
> *****************************************
>
--
Andres Felipe Acosta Gil
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user