Simulating dirt track races

Hello everyone. In another post recently about solo racing I wrote about how I run and time all the cars in a race and then load the data into a program I wrote that simulates all the cars being on the track at the same time. So far I use this for road course races involving up to 20 cars and it's worked well. Running a 20-car 70-lap Trans Am race requires creating a database of 1400 lap times and I love it.
I also plan to use this method for oval races, but there are some complicating factors that I don't have to deal with for road course races. If a car spins out on the road course I simply make a note of it and apply a time penalty for that car on that lap, and in the section of the track where it occurred. For example one section of my road course is called the Loop Turn, and it has an area with reverse banking - cars make a quick left hand turn while losing elevation. If a car comes out of the slot here I assign a time penalty depending on where the car ends up. This can greatly increase that amount of time a car takes to get through the section during the simulation and allows trailing cars to pass it. There are no caution flags and the rest of the field is not effected by any incident.
In oval dirt track racing things are more complicated. When a car spins out in a race at one of the full scale tracks I attend, the yellow flag comes out which slows the field down, the car(s) involved in the incident goes to the rear, and once the field is reassembled there in another running start to resume the race. The restart order is always based on what it was at the last completed lap, which means a pass doesn't count until it's recorded at the start/finish line. A car might pass several others on the back straight but if the caution flag comes out before the lap is scored (completed by the leader) the car will restart behind them. There is also the issue of when the caution flag comes out which determines if the current lap will count or not. If an incident occurs behind the leader(s) sometimes the flagman will hold off with the yellow flag till the leader crosses the start/finish line to move the race along. But I need some standard rules to encode in my program.
I'd appreciate the input of anyone interested regarding the sequence of things in this scenario. Here's my current thinking - if the leader causes the incident the yellow flag comes out immediately and the race pace is slowed, otherwise just slow down the car involved in the incident and let the other cars complete the current lap before the caution period begins. In either case the car responsible for the incident is assigned last place, and everyone who was behind them moves up one position while under the caution. A car's position is determined based on it's official position that last time it passed the start/finish line either to start the race or under green flag conditions. Another issue is should the lap counter be frozen during all caution periods? From my experiences this is always the case in heat and consolation races which are typically only 8 - 12 laps long. Feature races are another issue. At most northeast dirt tracks laps completed under caution only count till the halfway mark, so that a race can never end under caution. I like this arrangement and think I will opt for it, which will mean ignoring a car's recorded lap time on a lap that is under caution during the race simulation, and instead assign all of the cars a pace lap speed once the distance (time) between positions is set.
Am I missing anything?
Slothead
I also plan to use this method for oval races, but there are some complicating factors that I don't have to deal with for road course races. If a car spins out on the road course I simply make a note of it and apply a time penalty for that car on that lap, and in the section of the track where it occurred. For example one section of my road course is called the Loop Turn, and it has an area with reverse banking - cars make a quick left hand turn while losing elevation. If a car comes out of the slot here I assign a time penalty depending on where the car ends up. This can greatly increase that amount of time a car takes to get through the section during the simulation and allows trailing cars to pass it. There are no caution flags and the rest of the field is not effected by any incident.
In oval dirt track racing things are more complicated. When a car spins out in a race at one of the full scale tracks I attend, the yellow flag comes out which slows the field down, the car(s) involved in the incident goes to the rear, and once the field is reassembled there in another running start to resume the race. The restart order is always based on what it was at the last completed lap, which means a pass doesn't count until it's recorded at the start/finish line. A car might pass several others on the back straight but if the caution flag comes out before the lap is scored (completed by the leader) the car will restart behind them. There is also the issue of when the caution flag comes out which determines if the current lap will count or not. If an incident occurs behind the leader(s) sometimes the flagman will hold off with the yellow flag till the leader crosses the start/finish line to move the race along. But I need some standard rules to encode in my program.
I'd appreciate the input of anyone interested regarding the sequence of things in this scenario. Here's my current thinking - if the leader causes the incident the yellow flag comes out immediately and the race pace is slowed, otherwise just slow down the car involved in the incident and let the other cars complete the current lap before the caution period begins. In either case the car responsible for the incident is assigned last place, and everyone who was behind them moves up one position while under the caution. A car's position is determined based on it's official position that last time it passed the start/finish line either to start the race or under green flag conditions. Another issue is should the lap counter be frozen during all caution periods? From my experiences this is always the case in heat and consolation races which are typically only 8 - 12 laps long. Feature races are another issue. At most northeast dirt tracks laps completed under caution only count till the halfway mark, so that a race can never end under caution. I like this arrangement and think I will opt for it, which will mean ignoring a car's recorded lap time on a lap that is under caution during the race simulation, and instead assign all of the cars a pace lap speed once the distance (time) between positions is set.
Am I missing anything?
Slothead