Upcoming Games

(UTC times)


Full list
Add a game

Upcoming Events

No events to display

SwingSet not all swingable

You are here: Home > Forum > General > General questions, comments, and issues > SwingSet not all swingable

Page 1 of 1

SwingSet not all swingable 27/12/2014 at 17:03 #67109
clive
Avatar
2789 posts
The message "SwingSet not all swingable" has been mentioned on two threads recently. So I thought I should explain what it's all about.

A "swing set" is something inside the core code to do with points movements and overlap swinging. It's probably best explained using an example. Consider three parallel lines: up, reversible, and down. At a particular location there are two crossovers 505 and 507, from up to reversible and reversible to down respectively, parallel so that it's possible to have parallel moves along them simultaneously. In the up direction these are protected by signals 2 and 4 on the up and reversible respectively; in the down they are protected by 1 on the down and 3 on the reversible. The overlaps of these signals extend all the way to - or beside - the signal in the other direction.

Suppose that 3's overlap is set along the reversible to 4, so 505 and 507 are both normal. Now the signaller sets a route from 1 to the reversible. To maintain 3's overlap, we need to reverse 507 and "swing" the overlap. Similarly, if a route is set up to 4, this needs an overlap that doesn't conflict with the one already set, so again 3's overlap needs to be swung over 507 reverse with 4's overlap over 505 reverse. On the other hand, if the signaller sets a route up to 1, there's no need to alter the overlap of 3 at all. And so on.

Rather than having developers write custom logic for each such situation, with all the ensuing risks of bugs, the core code uses a generic approach. A "swing set" is a list of overlap and points requirements that are consistent with the situation and the new request. So in the case of setting a route from 1, the resulting swing set is "3 main, 505 reverse, 507 reverse" ("main" means a main route overlap). In the case of setting a route to 4, the swing set is "3 main, 4 main, 505 reverse, 507 reverse". On the other hand, when setting a route to 1, there are three possible swing sets:
* 1 main, 3 main, 505 normal, 507 normal
* 1 main, 3 main, 505 normal, 507 reverse
* 1 main, 3 main, 505 reverse, 507 reverse
When more than one swing set is possible, each is scored against various criteria and the best one wins: in this case that would be the first one, because that doesn't require any points to be moved.

Having chosen a swing set, the core code will move the relevant points and lock the correct overlaps. But first it makes a final check that everything is permitted. The "SwingSet not all swingable" message means that, contrary to expectations, something can't be done!

Note that this is a "can't happen" situation. If the message appears, there is a bug somewhere, either in the core code or in the specific simulation. Therefore, if you ever see the message we need to know what action triggered it (either setting a route or keying some points) and the exact positions of all the points and states of the routes in the area. Ideal would be a saved game immediately before the event and instructions on how to repeat it.

If the message does appear, you can click on "OK" and continue playing. However, in some circumstances it's possible for the simulation state to become inconsistent, such as conflicting points positions or an overlap set along one arm of facing points with the points in the other position! It's not necessary to report such inconsistencies separately and they will go away when the relevant routes and overlaps are cancelled and points swung (that is, they're not permanent).

Log in to reply
The following users said thank you: AndyG, Hawk777, Muzer, ozrail, Stanyon