How to park a vehicle in a random parking space? - sumo

I was wondering how to park a vehicle in a random parking spot. As can be seen from the attached figure, all vehicles park sequentially.
I have already defined all parking areas in the *.net.xml file and the vehicles that should park in the *.rou.xml file.
I am using SUMO 1.2.0.
Parking Area

You cannot assign a specific spot in a parking area, so yes defining multiple areas is probably the best option.

Related

Is it possible to model the Universe in an object oriented manner from the subatomic level upwards?

While I'm certain this must have been tried before, I cant seem to find any examples of this concept being done myself.
What I'm describing goes off of the idea that effectively you could model all "things" which are as objects. From their you can make objects which use other objects. An example would be starting at the fundamental particles in physics combine them to get certain particles like protons neutrons and electrons - then atoms - work your way up to the rest of chemistry etc....
Has this been attempted before and is it possible? How would I even go about it?
If what you mean by "the Universe," is the entire actual universe, the answer to "Is it possible?" is a resounding "Hell no!!!"
Consider a single mole of H2O, good old water. By definition a mole contains ~6*1023 atoms, and knowing the atomic weights involved yields the mass. The density of water is well known. Pulling all the pieces together, we end up with 1 mole is about 18 mL of water. To put that in perspective, the cough syrup dose cup in my medicine cabinet is 20mL. If you could represent the state of each atom using a single byte—I doubt it!—you'd require 1011 terabytes of storage just to represent a snapshot of that mass, and you'd need to update that volume of data every delta-t for the duration you wish to simulate. Additionally, the number of 2-way interactions between N entities grows as O(N2), i.e., on the order of 1046 calculations would be involved, again at every delta-t. To put that into perspective, if you had access to the world's fastest current distributed computer with exaflop capability, it would take you O(1028) seconds (on the order of 1020 years) to perform the calculations for a single simulated delta-t update! You might be able to improve that by playing games with locality, but given the speed of light and the small distances involved you'd have to make a convincing case that heat transfer via thermal radiation couldn't cause state-altering interactions between any pair of atoms within the volume. To sum it up, the storage and calculation requirements are both infeasible for as little as a single mole of mass.
I know from a conversation at a conference a couple of years ago that there are some advanced physics labs that have worked on this approach to get an idea of what happens with a few thousand atoms. However, I can't give specific references since I haven't seen the papers and only heard about it over a beer.

How to access the SUMO vehicles from highway_overtake.py in Webots?

I'm modifying the highway_overtake.py controller to be able to track the position and speed of the neighboring SUMO vehicles (the ones that are highlighted in transparent colored boxes). How can I access the SUMO vehicle information that is in close proximity of the Lincoln car? I want to get the position, acceleration, speed etc. of the SUMO cars highlighted near the Lincoln car. Here is what I have tried so far:
I have changed the 'supervisor' field to TRUE in the highway overtake world for the lincoln MKZ vehicle node.
I imported the Supervisor from controller in my higway_overtake.py controller file.
I tried calling the traci functions getIDList() and getPosition() but it gives an error that says controller doesn't have any such attributes.
I believe this information can be retrieved from the SumoSupervisor.py file which is the controller file for Sumo Interface. But I do not know how to access this file in my highway_overtake.py script either.
Any information that can help me solve this will be very helpful!
Thanks in advance.
If it's for debugging, you could use this supervisor function to get the positon of all cars in the simulation, and then figure out which one is closed to your target car (which ID you know).
https://cyberbotics.com/doc/guide/supervisor-programming#tracking-the-position-of-robots
Otherwise, if you want to use only functions that are available to actual machines, try the emitter/receiver devices. You might be able to use signal strength as a proxi for proximity, or, if there's a synced tick, use signal reception time as a proximity detector.
Or use GPS modules (with an high enough resolution) on each car and compare the coordinates.

Best Way to Determine if Address is in NY Tri State Area

I'm working on a coding problem where I potentially need to flag any locations in user entered addresses that are in the NY Tri-State area.
Unfortunately I'm not that familiar with the US addressing system, so I'm not sure of the best way to start.
Other than using a geoshape and checking if the lat/longs of the locations fall within the shape, is there a simpler/more efficient way of checking if a US address is in that area?

Strategy to tackle knapsack binded with travelling salesman

I have been assigned the following problem as a research topic for summer. However, I have not been able to successfully find related problem, except that it seems to be a combination of travelling salesman with the knapsack, even though I'm not sure if that is the case. The statement is:
You are a truck driver who earned a big contract and now you must
deliver a lot of packages. There are N packages to be delivered, each
one has to be delivered at a certain address (x,y) on the city.
Additionally each package i has a weight Wi.
For simplicity, suppose the distribution area is rectangular and you
always start at the point (0,90).
You only have one truck, with limited capacity of 1000 (excluding
truck weight). The truck base weight is 10.
The distances to be travelled are far away, so the distance shall be
computer using Haversine distance.
The company who contracted you will provide you with enough fuel, so
you can make unlimited ammount of travels.
However, you must be very careful while delivering the packages since
you must deliver every single one of them and, if you choose to pick
up a package during a trip, you must deliver it no matter what, you
can't leave them in the middle of your trip.
As you are a bit miserly, you agree on the conditions, but you know
that if you don't take a close to optimal strategy, your truck can
wear too much, so you could end leaving the contract incomplete,
which will get you sued and leave you without truck and money.
So, due to your experience, you know that to maximize the chances of survival
of your truck, you must minimize the following function:
http://goo.gl/jQxXzN (sorry, I can't post images because I have not enough reputation).
where m is the number of tripss, n is the number of packages for each trip j, wij is the weight of the i-th gift during the j-th trip, Dist represents Haversine distance between two points, Loc(i) is the location of the i-th gift, Loc(0) and Loc(n) are the (0,90) point (starting point), and wnj (last weight of the trip) is always the truck weight (base weight).
So, basically, those are all the restictions of the research topic I got.
I have been thinking maybe some metaheuristics such as ant collony or genetic algorithms could be of help, but I would have to get to know the problem a bit better. Any idea or information (paper, book, etc) is welcomed.
This sounds like a variation of the Capacitated Vehicle Routing Problem (CRVP), specifically with with single-vehicle and single-depot (however with non-uniform packages). For some reference on this problem, see e.g.:
On the Capacitated Vehicle Routing Problem (T.K. Ralphs, L. Kopman, W.R. Pulleyblank, and L.E. Trotter, Jr)
Modeling and Solving the Capacitated Vehicle Routing Problem on Trees (B. Chandran and S. Raghavan)
I think your idea of metaheuristics---ant colony optimisation (ACO) in particular---would be a wise approach. Note that for TSP related problems, generally ACO is to prefer over genetic algorithms (GA).
Possibly the following somewhat well known article (1) can get you started to studying the possible benefits of ACO approach. (2) extends the result from (1). Note that this covers the regular VHP (no capacitated), but it should prove valuable as a starting point, the least giving inspiration.
SavingsAnts for the Vehicle Routing Problem (K. Doerner et al.)
An improved ant colony optimization for vehicle routing problem (Yu Bin et al.)
There also seems to exists literature specifically one the subject of ACO and CVRP, but I cannot comment to the quality of these, but I'll list them for you to inspect by yourself. Note that (3) is an extension from the authors of (1).
Parallel Ant Systems for the Capacitated Vehicle Routing Problem (K. Doerner et al.)
Ant Colony Optimization for Capacitated Vehicle Routing Problem (W.F. Tan et al.)
Sound like an interesting research topic, good luck!

Google Maps Shading of Australian Suburbs

I need a way to shade Australian suburbs in different colours based on my input.
Not sure of how to do this with Google Maps API.
Google maps has Australian suburbs boundaries and I want to tell Google Maps to shade each Suburb a different colour based on my instruction. I am very very open to how to do this.
My goal is to have a Google Map that is interactive that has suburbs shaded different colours. You can zoom out and look across a region and see if there are suburbs in common or with different colours. The key would be based on things like Median house price, house sale volumes, demographics etc.
Why: There are 3 reasons to do this.
To place a screenshot in a powerpoint report
Send a link to a client and show them their area with different information encoded
Built a system in the future that pulls this from a DB and generates this as part of a web portal
How: I have a spreadsheet with information like: Cherrybrook, Red, Castle Hill, Blue, Kellyville, Pink (or HTML colours, or numbers - whatever the format required can be generated).
If possible I also want to label the suburbs based on the colour that they become (this may be a Google Earth feature).
You might be able to use the Polygon class, but there are performance limits on how many polygons you can show at once. If you only show one metro area at a time, you might be okay.
More likely, you will want to create tiles. See
https://developers.google.com/maps/documentation/javascript/overlays
for documentation on tiles.
This is very powerful. You can see, for example, a web site I and a friend made which shows Australian 2006 census data by census tract by using tiles at:
http://sunburntpeople.com/census/