# Uniform Circle Formation for Fully, Semi-, and Asynchronous Opaque Robots with Lights
## 6 The Algorithm for the Semi-Synchronous Mode
For \(k=2\), the **first epoch** is used to properly color the two pivots, elected as in the FSynch mode. A peculiar approach is now explained for the next three epochs which deflects from the usual strategy in the setting of the safe diameters. Let \(w\) be the angle-string between the two pivots. Two cases can occur: _(i)_\(w=w^{R}\) and _(ii)_\(w\
eq w^{R}\). For \(w=w^{R}\) both sectors can be divided into two halves having the same number of robots. In this pattern, the robots at the endpoints of the main diameter \(d\) color themselves as _pivot_r2_ (**first epoch**). Moreover, the angle robots will complete the regular 3-tuples around the endpoints of \(d\), as usual **(second epoch**). Being a palindrome, \(w\) does not allow robots to set an _upper_ endpoint of \(d\). For this reason, a different strategy is needed to guarantee robots can see at least three robots on the SEC, and to move at most three robots per sector to set the regular tuples (i.e., apply Theorem 2). Hence, the diameter perpendicular to \(d\) is elected as the new main diameter \(d^{\prime}\). If some robots are lying on \(d^{\prime}\), they are in their final position, \(w\) being a palindrome. Otherwise, \(d^{\prime}\) splits two opposite polygon edges. The algorithm continues by setting the safe diameters parallel to \(d^{\prime}\) and following the strategy for the asymmetry case (i.e., by making robots rappel down on the new safe diameters in the **third epoch** and by making them go back to the SEC in the **fourth epoch**). In case _(ii)_\(w\
eq w^{R}\), the strategy for the _(i)_ case can be properly adapted. A regular 3-tuple (_angle_, _pivot_r3_, _angle_) is set at each endpoint of the main diameter \(d\) (**first** and **second epoch**). Let \(d^{\prime}\) be the perpendicular diameter to \(d\). Note that also \(d^{\prime}\) (like \(d\)) splits the SEC into two half-SECs with the same number of robots. By counting themselves, robots can understand if the endpoints of \(d^{\prime}\) are vertices of the target \(n\)-gon. As a consequence, at most one robot per half-SEC must move _from_ or _to_ the related endpoint of \(d^{\prime}\), according to the position of the vertices. These movements can be achieved during the second epoch,together with the angle robots. This, in turn, assures Theorem 2 can be properly applied. Now, the **third** and **fourth epoch** follow as the case (_i_). Two main classes of symmetry. In the **first epoch**, each activated robot checks if it is a placeholder and, if so, it sets its light as _placeholder_, and no robot moves. In the **second epoch**, each activated robot sees all the placeholders have been set, so it is time to move robots on the SEC to set the pivots (with the color _pivot_r4_) and angles. Each robot can spot its own slice (as in the fsynch algorithm). If the positions for _pivot_r4_ or _angle_ of the slice are not occupied yet, one or two robots belonging to the slice can be selected unambiguously to move safely in those positions and complete the regular 4-tuple (_angle, pivot_r4, pivot_r4, angle_) for the whole sector. The other robots do nothing. In the **third epoch**, each activated robot, which is neither _pivot_r4_ nor _angle_, acts like this: it spots its sector and the safe diameter (two sectors case) or the safe symmetry chord (more than two sectors case), it computes its index within the robots on the sector (by counting robots on the SEC and on the safe segments) and the projection of its target position on the safe segment. It rappels down on this projection, changing its color in _internal_. In the **fourth epoch**, each activated robot with _internal_ color spots the SEC and its sector, it sets its color as _sec_, and it travels towards the SEC perpendicularly to the safe segment.