The truth is that I have been out of town with another fantastic girlfriend, and my attention has been divided badly between being with her and doing fun things and being in one of the United States’ republics with a reputation for being rather hostile towards no fewer than three of the minorities to which I belong.
The former has certainly weighed more heavily on my productivity, but the latter contributed little, as well. In any case, I find myself back in my home now and am gleefully ensconced in my underachievement, staring at reflections in my own river of mediocrity, desperately fighting the urge to dive in and seize the glittering images taunting me from its surface.
(Not in a Narcissus sort of way but more like Li Bai*.)
Anyway, in the time since my return (it has been three days, more or less), I have managed to complete most of the code in my Stupid Jaywalking Game (and that is its working title, by the way) required for the automatic construction of Intersections and their attendant components, which include entry and egress points (Nodes) for vehicles transiting the intersection, generation of Routes for vehicles to follow between them, and methods which produce graphics which represent the intersection area to the player.
... IXN = { 'center' : (300,300), 'control' : 'SIGN', # currently does nothing. 'edges' : { 'N' : { 'inputs' : { 'n_left' : ('ENTRY', (40, 40), (215, 40), ('B', 265, 40), (265, 90), (265, 220)), 'n_right' : ('ENTRY', (560, 40), (385, 40), ('B', 335, 40), (335, 90), (335, 220)) }, }, 120 : { 'outputs' : { '120_out' : (('A', 110, 120, (300,300)), ('A', 240, 120, (300,300)), ('B', 'A', 300, 120, (300,300), 12), (580, 450)) }, }, 240 : { 'outputs' : { '240_out' : (('A', 110, 240, (300,300)), ('A', 240, 240, (300,300)), ('B', 'A', 300, 240, (300,300), 12), (20, 450)) }, }, }, 'links' : { 'n_left' : ('240_out','120_out'), 'n_right' : ('120_out',) } } ...
I have also reworked the vehicle navigation code, which, previously, was the software engineering equivalent of a Novocaine-addicted dog’s breakfast (”profoundly messy,” I mean). It was a bit of work but I find myself pleased with the results; I am also surprised that it was only a half-day’s work. I am not sure if the code runs faster (the most micro of optimizations, if better at all) but it sure does look better and it ought to be easier to maintain.
More significantly, it ought to be able to include and respond to Stoplights and Stop Signs, which are instrumental considering that the whole purpose here is to create a predictable traffic regime for the player to negotiate and not just a busy roadway. All I need to do now is actually write the signal controllers for the intersections and get it working.