you may recognize this as a familiar question from me-- but, i think i may have finally figured out what i need help with-- in the past we've talked about database normalization,etc-- but i want to focus instead on formulas / equations/ conditional logic, etc this time so that i have a better idea of how i might begin to code the functional aspect of this app. so, what i'm looking for is help with What kind of conditional logic / classes / recursion (whatever!)-- in general -- programming/ scripting technique should i employ to achieve my desired result with the following data. NOTE: i'm not asking for a "solution" but just ideas on how to approach this type of problem. there's a good bit to consume here in my inquiry, so if you are short on time, you may rather pass this one over. however, if you do have an extra moment, then thanks for your willingness to help, and please read on with patience. thanks! oh, and by the way-- i ain't makin' money from this project, for the record. it's something i agreed to do a few months ago, and also because i wanted the experience. bit off more than i could chew, obviously-- but i have learned, that's for sure-- i just feel bad for the "client". yep-- made my bed, and now lying in it is becoming uncomfortable-- i'm not afraid to admit that!
okay-- here's my "problem":
i have multiple geographical locations (stops on a city commutor's public bus route), each of which has an associated Time-of-day, and an associated Bus. ($loction, $time and $bus, we could say or $location.time and $bus.location perhaps)
each of these locations has a certain unique attribute that must also be factored into an equation:
considering their location, in very general terms, be it East, South, West, or North of the city, which Bus will the person ride?
for example, we could say the E bus handles East side, W handles the West, N the north-side of town, etc.. My goal is to develop an application which will plot, for example, for a Rider living on the North side of town, which bus route, and at which geographical bus-stop location(s) he must be present in order to ride to a "final destination", for example, on the South-East end of town.
The busses have transfer points at which North would end, and South would pick-up and take over. I need to get my rider from point A to point B. So, if our rider wants to go to a South-East point B, let's assume that he must not only travel South from his Northern point A, but also East. so, our Northern rider will need to know which southerly location he must mark as destination #1, so that he will be present at the correct easterly pickup point in order to ride the correct East bus to arrive at his final South-East destination.
I have data in tables already which indicates time-of-day info for each geographical location all across town. the data that i have to work with for my calculations are as follows:
each location has the following:
"bus-stop-code" (VARCHAR) for the geographical location
"route-pickup-time" (TIME) and it's associated "time-code" (INT) for time-of-day
"bus-route-name" (VARCHAR) for knowing which bus to ride
and other data.
i already have a form which performs a SELECT ... CROSS JOIN query which allows the user to select a geograpical "bus-stop-code", and that query returns info showing at what time a bus passes that location, what is the bus name which passes it, and whether that location is one which any other busses pass by, allowing the rider to transfer, for example, from a northerly route to an easterly route. it is functional, and displays accurate data. now i just need to put that data to use in a "prediction" form so that i can let this user select not only one location, but two-- and the results should show the user an idea of when and where he needs to be, and what bus-name he will need to ride to make it to his final destination.
i posted these table descriptions a while ago-- re-examined them just now, and i think all i've changed since then are the ENUM's from yes/no to 1's and zeros instead. oh, and there are several more identical to these. only 2 of 13 similar bus-route table-groups are represented here.