# Efficient scheduling of astronomical observations. Application to the CARMENES radial-velocity survey.

A. Garcia-Piquer, J. C. Morales, I. Ribas, J. Colomé, J. Guàrdia, M. Perger, J. A. Caballero, M. Cortés-Contreras, S. Jeffers, A. Reiners, et al.

► To cite this version:

A. Garcia-Piquer, J. C. Morales, I. Ribas, J. Colomé, J. Guàrdia, et al. Efficient scheduling of astronomical observations. Application to the CARMENES radial-velocity survey. Astronomy & Astrophysics - A&A, 2017, 604, pp.A87. 10.1051/0004-6361/201628577. hal-02197552

HAL Id: hal-02197552

https://hal.science/hal-02197552v1

Submitted on 9 Aug 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Efficient scheduling of astronomical observations

## Application to the CARMENES radial-velocity survey

A. Garcia-Piquer<fnref n="1" />, J. C. Morales<fnref n="1" />,², I. Ribas<fnref n="1" />, J. Colomé<fnref n="1" />, J. Guàrdia<fnref n="1" />, M. Perger<fnref n="1" />, J. A. Caballero³,⁴,
M. Cortés-Contreras⁵, S. V. Jeffers⁶, A. Reiners⁶, P. J. Amado⁷, A. Quirrenbach³, and W. Seifert³

¹ Institut de Ciències de l'Espai (IEEC-CSIC), Campus UAB, C/Can Magrans s/n, 08193 Bellaterra, Spain
e-mail: agarcia@ice.cat

² LESIA-Observatoire de Paris, CNRS, UPMC Univ. Paris 06, Univ. Paris-Diderot, 5 Pl. Jules Janssen, 92195 Meudon Cedex, France

³ Landes sternwarte, Zentrum für Astronomie der Universität Heidelberg, Königstuhl 12, 69117 Heidelberg, Germany

⁴ Centro de Astrobiología (CSIC-INTA), Camino Bajo del Castillo, 28691 Villanueva de la Cañada, Madrid, Spain

⁵ Departamento de Astrofísica y Ciencias de la Atmósfera, Facultad de Ciencias Físicas, Universidad Complutense de Madrid,
28040 Madrid, Spain

⁶ Institut für Astrophysik, Friedrich-Hund-Platz 1, 37077 Göttingen, Germany

⁷ Instituto de Astrofísica de Andalucía (CSIC), Glorieta de la Astronomía s/n, 18008 Granada, Spain

Received 23 March 2016 / Accepted 18 July 2017

## ABSTRACT

**Context.** Targeted spectroscopic exoplanet surveys face the challenge of maximizing their planet detection rates by means of careful planning. For a large planet survey, the number of possible observation combinations, i.e., the sequence of observations night after night, both in total time and amount of targets, is enormous.

**Aims.** Sophisticated scheduling tools and the improved understanding of the exoplanet population are employed to investigate an efficient and optimal way to plan the execution of observations. This is applied to the CARMENES instrument, which is an optical and infrared high-resolution spectrograph that has started a survey of about 300 M-dwarf stars in search of terrestrial exoplanets.

**Methods.** We used evolutionary computation techniques to create an automatic scheduler that minimizes the idle periods of the telescope and distributes the observations among all the targets using configurable criteria. We simulated the case of the CARMENES survey with a realistic sample of targets, and we estimated the efficiency of the planning tool both in terms of telescope operations and planet detection.

**Results.** Our scheduling simulations produce plans that use about 99% of the available telescope time (including overheads) and optimally distribute the observations among the different targets. Under such conditions, and using current planet statistics, the optimized plan using this tool should allow the CARMENES survey to discover about 65% of the planets with radial-velocity semi-amplitudes greater than $1 \text{ m s}^{-1}$ when considering only photon noise.

**Conclusions.** The simulations using our scheduling tool show that it is possible to optimize the survey planning by minimizing idle instrument periods and fulfilling the science objectives in an efficient manner to maximize the scientific return.

**Key words.** instrumentation: spectrographs – methods: miscellaneous – surveys – planetary systems – stars: late-type

## 1. Introduction

Radial-velocity surveys, together with dedicated photometric space missions such as CoRoT and *Kepler*, have proved to be the most efficient way to discover exoplanets. Radial-velocity surveys have generally been focused on solar-type stars, but recently the interest in planets orbiting late-type stars has increased. Owing to their lower mass, the radial-velocity semi-amplitude induced by rocky planets around M dwarfs is 1.5–5 times larger than in the case of solar-type stars for similar orbital periods. This makes low-mass stars uniquely suited to the detection of Earth-like planets provided that instruments at the $1 \text{ m s}^{-1}$ precision level are available. Particularly interesting are rocky planets in the habitable zones of their host stars, whose radial-velocity signals can reach a few $\text{m s}^{-1}$ in the case of M dwarfs. However, a spectroscopic survey of low-mass stars has to face two main challenges: 1) the targets are generally faint; and 2) they show higher levels of intrinsic variability due to higher stellar magnetic activity than Sun-like stars. For this reason, less than 100 exoplanets out

of the over 3500 known to date have been discovered orbiting M dwarfs (e.g., Bonfils et al. 2013; Delfosse et al. 2013; Tuomi et al. 2014; Astudillo-Defru et al. 2015), and most of these are around early-M dwarfs.

CARMENES<fnref n="1" /> (Calar Alto high-Resolution search for M dwarfs with Exo-earths with Near-infrared and optical Échelle Spectrographs) is a next-generation instrument aimed at the discovery and study of a statistically significant sample of exoplanets around M dwarfs using precise radial velocities. The CARMENES instrument is mounted on the 3.5 m Zeiss telescope at the Calar Alto Observatory (Almería, Spain; Sánchez et al. 2007, 2008) and was built by a German-Spanish consortium (Quirrenbach et al. 2014). This instrument consists of two spectrographs, one sensitive to visible light and another that is sensitive to the near-infrared. The radial-velocity precision is expected to be on the order of $1 \text{ m s}^{-1}$; this is similar to current instruments in the visible, such as HARPS (Mayor et al. 2003) and HARPS-North (Cosentino et al. 2012). However, the

<footnote n="1">¹ http://carmenes.caha.es</footnote>
main advantage of CARMENES is the simultaneous measure-
ment of Doppler shifts over a very wide spectral range from the
visible (>0.52 µm) to the near-infrared (<1.71 µm). The infrared
channel is designed to monitor the radial velocity of stars in the
wavelength region of the spectra where late-type dwarfs emit
the bulk of their light. On the other hand, the visible channel
has plenty of radial-velocity information (spectral lines are abun-
dant) as well and the combination with infrared measurements is
ideal to monitor stellar activity, thus providing a means of disen-
tangling true exoplanet signals from other effects (Reiners et al.
2010, 2013). As part of the guaranteed-time observations (GTO),
CARMENES is surveying about 300 M dwarfs (Caballero et al.
2013; Alonso-Floriano et al. 2015). The commissioning of the
instrument ended in December 2015 and regular operations
started in January 2016. The GTO survey will extend for at least
three years, using over 600 nights of telescope time with the goal
of discovering dozens of new planets, particularly focusing on
those residing in the habitable zones of their stars.

One of the major challenges of the CARMENES survey is
efficient planning of observations of the numerous targets in the
sample. In general, any kind of astronomical survey requires the
execution of a large number of observations fulfilling several
constraints. Some of these constraints can be predicted (e.g.,
visibility and elevation of the object) and have to be necessar-
ily satisfied and others are unknown until the time of execution
of the observations (e.g., integration time, environmental con-
ditions). In addition, there are some scientific constraints that
should be optimized, such as the number of targets that have
to be observed and the number of observations of each target
(Perger et al. 2017). The optimization of these constraints is a
key factor for obtaining a suitable schedule with an adequate ex-
ploitation of the resources and a high scientific return. Owing
to the large number of parameters involved, the planning and
scheduling of observations carried out by human operators is a
laborious and complicated process that does not guarantee an
optimal result.

The CARMENES GTO survey also includes careful plan-
ning of observations to ensure the most efficient use of the
telescope time and thus to maximize the science output. Al-
though most past surveys have used a manual approach to plan-
ning, new projects increasingly appreciate the importance of
carefully optimizing the observation schedule. In this sense,
different mathematical tools to solve automated planning and
scheduling problems have been developed, ranging from sim-
ple heuristics to more complex artificial intelligence applications
(Donati et al. 2012; Kitching & Policella 2013). Examples in-
clude the scheduling tools of ALMA (Espada et al. 2014), Las
Cumbres Observatory Global Telescope (Brown et al. 2013),
EChO (Garcia-Piquer et al. 2014c), the Automated Planet Finder
Telescope (Burt et al. 2015), MrSPOCK for the Mars Express
mission (Cesta et al. 2009), the James Webb Space Telescope
(Giuliano et al. 2011), and the SOFIA mission (Civeit 2013). To
complement these examples, a summary of other planning and
scheduling tools used in astronomical observatories can be found
in Colomé et al. (2012).

In particular, genetic algorithms (hereafter GAs), which are
evolutionary computation (EC) techniques (Holland 1975), are
very useful for this purpose. The EC technique is an artificial
intelligence subfield focused on emulating natural evolution by
means of combining potential solutions using selection, combi-
nation, and mutation operators (Freitas 2002). The goal of GAs
is to efficiently explore a large amount of potential solutions in
order to find near-optimal solutions (Goldberg 1989) fulfilling all
constraints and optimizing the goals defined in the problem. The

techniques of GAs must be adapted to the particularities of the
problem to obtain suitable results (Garcia-Piquer et al. 2014a).
Generally, a scheduler for astronomical observations has more
than one parameter that needs to be optimized, resulting in a
multi-objective optimization problem (MOP) that can be defined
as the problem of finding a vector of decision variables satis-
fying constraints and optimizing a vector function whose ele-
ments represent the objective functions (Osyczka 1985). These
functions form a mathematical description of performance cri-
teria that are usually not disjoint (i.e., they are in conflict with
each other). Hence, the term “optimize” refers to finding a so-
lution that yields acceptable values for all objective functions
(Coello Coello 1999). Usually there is not a single point that si-
multaneously optimizes all the objective functions of a MOP.
Therefore, in these problems it is necessary to look for trade-offs,
rather than single solutions. The concept of Pareto optimality
(Pareto 1897) enables us to consider a Pareto optimal when no
feasible vector of decision variables exists that would decrease
some criterion without causing a simultaneous increase in at
least one other criterion. Thus, this concept almost never yields
a single solution but yields a set of solutions called the Pareto
optimal set. All solutions included in the Pareto optimal set are
non-dominated (i.e., there is no solution better than the rest) and
they have a different trade-off between objectives (Garcia-Piquer
2012). The plot of the objective functions whose non-dominated
vectors are in the Pareto optimal set is called the Pareto front (see
Coello Coello 1999, 2001, for further details). Multi-objective
evolutionary algorithms (hereafter, MOEAs; Coello Coello et al.
2007) are recognized as one of the most valuable and promis-
ing approaches to addressing complex and diverse problems of
multi-objective optimization.

In this paper we present in detail the scheduling tool de-
veloped in the context of the CARMENES GTO survey, al-
ready introduced in Garcia-Piquer et al. (2014b). Although it
has been designed for a radial-velocity application, it is seam-
lessly adaptable to other purposes and constraints (see, e.g.,
Garcia-Piquer et al. 2014c). In Sect. 2 we describe the general
implementation of the scheduling tool based on GAs. In Sect. 3
we apply the constraints of the CARMENES survey and we ana-
lyze the efficiency of the scheduling algorithms in terms of tele-
scope and instrument operations. Finally, in Sect. 5 we analyze
the results of the optimal schedule calculations to assess their
scientific efficiency in the case of a radial-velocity survey and
to estimate the CARMENES expected exoplanet yield. The con-
clusions are presented in Sect. 6.

2. CARMENES scheduling tool

The first step in scheduling an astronomical survey is the prepa-
ration of the sample of targets and identification of observa-
tional constraints that may be defined by the target stars, tele-
scope and instrument design, and science requirements. As
mentioned above, CARMENES will carry out a survey of
~300 M dwarfs for a period of at least three years. For this
paper, we have used a list of 309 high-priority potential target
candidates compiled in the CARMENES input catalog (dubbed
Carmencita; Caballero et al. 2013; Alonso-Floriano et al. 2015).
The CARMENES science objectives are designed for at least
60 observations to be obtained for each target. These high-
priority M dwarfs are selected from a larger sample by remov-
ing systems that are unsuitable for the survey (e.g., faint stars in
the J band for their spectral subtypes, or spectroscopic or close
visual binaries). The list comprises targets distributed among all
<figure><img src="image_2.png" /><figcaption>**Fig. 1.** Top: Mollweide projection of the distribution on the sky of the 309 CARMENES targets used in our simulations. Bottom: spectral type distribution of the targets. In both panels, filled symbols and bars indicate active stars with the $H\alpha$ line in emission.</figcaption></figure>

M-dwarf spectral subtypes as shown in Fig. 1, which also depicts the distribution of targets on the sky. The *J* magnitude ranges from 4.2 to 11.2 mag with a mean value of 7.7 ± 1.0 mag. For simplicity, the simulation experiments presented in this paper assume that all targets have the same priority. However, an external priority value is included in the description of the algorithm. This is because such functionality has been implemented in the operational CARMENES scheduler in case it needs to be considered for the optimization over the course of the survey (e.g., to increase the measurement cadence of interesting targets or to sample specific periods). This priority is an integer value that is assigned to each target by a user with higher values indicating higher priority.

Regarding the constraints of the survey, they can be divided into two different categories: hard constraints and soft constraints. The first constraints have to be necessarily satisfied and the second constraints express a preference of some target combinations over others. Thus, the final scheduling solution must fulfill all hard constraints and should optimize soft constraints.

## 2.1. Scheduling constraints

In the case of the CARMENES GTO survey, the hard constraints implemented in the CARMENES Scheduling Tool (hereafter CAST) are mainly related to the visibility of the targets from the Calar Alto Observatory, the operation overhead times, and the environmental conditions. These restrictions can also be adapted for other surveys and facilities such as space-based telescopes (see, e.g., Garcia-Piquer et al. 2014c). The *hard constraints* identified are summarized in Table 1 and are described as follows:

1. *Night.* The object shall only be observed from afternoon twilight to morning twilight. The coordinates of the targets on

<table><caption>**Table 1.** List of CARMENES observational constraints.</caption><thead><tr><th>Constraint</th><th>Category</th><th>Computation</th></tr></thead><tbody><tr><td>Night</td><td>Hard</td><td>In advance</td></tr><tr><td>Elevation</td><td>Hard</td><td>In advance</td></tr><tr><td>Moon influence</td><td>Hard</td><td>In advance</td></tr><tr><td>Visibility duration</td><td>Hard</td><td>In advance</td></tr><tr><td>Pointing</td><td>Hard</td><td>In advance</td></tr><tr><td>Overlapping</td><td>Hard</td><td>In advance</td></tr><tr><td>Overhead time</td><td>Hard</td><td>In advance</td></tr><tr><td>Environmental conditions</td><td>Hard</td><td>On the fly</td></tr><tr><td>Observing time</td><td>Soft</td><td>In advance<br>On the fly</td></tr><tr><td>Observation deviation</td><td>Soft</td><td>In advance</td></tr><tr><td>Observing cadence</td><td>Soft</td><td>In advance</td></tr></tbody></table>

the sky and twilight times are computed according to the date of observation and location of the observatory. Additionally, if needed, the observability window of each target can be computed according to given ephemerides for the case of objects with periodic variability. For this paper we considered the start of the astronomical twilight at Calar Alto Observatory as a conservative approach (Sun at −12 deg elevation).

2. *Elevation.* The elevation of each object is calculated according to its equatorial coordinates and the geographic coordinates of the observatory. The objects shall only be observed if they exceed a specific elevation for at least a certain amount of time. The elevation and time are two parameters that can be introduced in the global configuration of CAST. For CARMENES, the scheduling requirement is that a target must be above 30 deg for a time span longer than its estimated integration time.

3. *Moon influence.* Targets shall be observed when 1) the Moon is below the horizon or 2) the Moon is sufficiently far so that the observation is not significantly contaminated by background light. We established that the minimum acceptable distance to the Moon ($r_{min}$) is 20 deg. Beyond this distance, a hard constraint function on the Moon is evaluated to select only targets that are at least 5 mag brighter than the background (see Appendix A.1 for further details).

4. *Visibility duration.* The total time during which the *night*, *elevation*, and *moon influence* constraints are fulfilled shall be equal or higher than the minimum visibility time required for a target observation. This minimum time corresponds to the exposure time, which is computed using a calibration as a function of *J*-band magnitude with real CARMENES observations (see Appendix A.2 for more details). The maximum exposure time is set to 30 min to avoid biasing the barycentric correction. This exposure time limitation only affects 35 late-type dwarfs in our sample, which would need longer integration times according to their *J*-band magnitude. However, the effect of the reduction of exposure time is counterbalanced by the fact that for faint targets, typically late M-dwarf stars, the radial-velocity precision needed to detect planets is not as high as for earlier types.

5. *Pointing.* In case of pointing restrictions, targets shall only be observed if they are between minimum and maximum elevations as defined by the survey requirements. Moreover, in the case of CARMENES, the telescope dome has a segmented hatch that allows five open window configurations with different apertures (see Appendix A.3 for more details). If the window configuration needs to be changed (because
of vignetting) during target integration, the slide would temporarily block the telescope aperture and the observation would be affected. Thus, an observation is only selected if the target can be observed without being obstructed for the entire duration of the estimated integration time.

6. Overlapping. In operational terms, there are three kinds of tasks to be considered: 1) a target observation, 2) a readout of the previous observation, and 3) slewing to acquire a new target. Only tasks 2) and 3) can be executed in parallel.

7. Overhead time. Pointing to a particular object requires a specific telescope and instrument configuration. The time between consecutive observations considers both the telescope slew and acquisition time and the instrument readout time. The former includes the time needed to move the dome, hatch, and telescope, and an overhead slew time for acquisition, while the latter is defined by the detector properties. We assume the total overhead time between observations to be the duration of the process that takes a longer time (see Appendix A.4 for the detailed logical operations). For the CARMENES scheduler, we assume a telescope and dome slew rate of 1 deg per second and 60 s to change the dome hatch; the segments can be moved together, so the time overhead is independent of the number of segments to move. The overhead slew time is 120 s and the detectors readout time is less than 40 s.

8. Environmental conditions. An observation can be programmed when the environmental conditions permit. In operation mode during the survey, the CARMENES instrument control system (Garcia-Piquer et al. 2014b) informs CAST if the environmental conditions are suitable for observation. In the simulation mode presented here, we used a weather model based on Calar Alto environmental conditions from 2004 to 2006 (Calar Alto Observatory, priv. comm.), thus taking the influence of seasonal weather into account. We assumed that the dome is closed if: 1) relative humidity reaches 98%, and must be closed until it is equal to or below 95% for at least 20 min; 2) the outside temperature is below -15 °C; or 3) the wind speed is above 24 m s⁻¹. Furthermore, to be conservative, we assume that a given night has a maximum probability of 20% of cloudiness in low humidity conditions or of technical issues impeding observations. And, finally, the simulator increases the integration time randomly up to 20% to simulate the effect of high clouds.

On the other hand, in terms of scheduling, science requirements are identified as *soft constraints*. These restrictions are also summarized in Table 1 and include

1. *Observing time.* The integrated global observing time (i.e., the time that the telescope is observing), especially that of high-priority objects, should be maximized. This guarantees that the most interesting targets are sufficiently observed.

2. *Observation deviation.* The variance of the number of times that objects of the same priority have been observed in the complete survey should be minimized. This constraint should ensure that all targets will have a proper share of assigned observing time.

3. *Observing cadence.* It is possible to select the number of observations per night required for each target. As an optional constraint, the planning tool includes functionality to observe the targets at appropriate times to increase planet detectability by, for example, averaging the intrinsic stellar noise on radial velocities (see, e.g., Dumusque et al. 2011a,b) or by optimizing the periodogram window function over a certain orbital period interval (i.e., avoiding peaks

or gaps). In case of transient objects, target ephemerides are considered. For the present work, we assume that each target will be observed no more than once per night and randomly for the duration of the survey.

Some of the constraints can be computed in advance but others, such as weather conditions (environmental conditions), can only be determined in real time during observations and the scheduler must be reactive to their variations. For this reason, although it is an independent system, CAST is connected with the instrument control system from which it receives environment parameters and returns an observation request optimized according to current conditions. In order to reduce waiting times, one of the CAST requirements is that it should invest less than five seconds in selecting the next target to be observed. The simultaneous fulfilment of the hard constraints and the optimization of the soft constraints should provide a scheduling solution that maximizes the scientific return of the survey.

## 2.2. Scheduling optimization

Given the large number of targets of the CARMENES sample and its conditions, the complexity in computing the enormous amount of possible combinations in search of a near-optimal scheduling solution is not affordable for human operators. Hence, the scheduling of CARMENES observations can be addressed as a constraint-satisfaction problem, which is a combinatorial problem that seeks an assignment of values to its variables that satisfies all given constraints. The algorithms used to find the optimal solution to these kinds of problems require a computation time that grows exponentially with the size of the input. Consequently, approximate or heuristic methods are useful to find feasible solutions, or those that satisfy most of the constraints in a reasonable computation time (Nonobe & Ibaraki 1998). In CAST, GA techniques are implemented to efficiently explore the large amount of potential combinations of observations with the goal of selecting those that are more efficient.

The algorithms of CAST were presented in Garcia-Piquer et al. (2014b) but we provide the basic details here. Two scheduling strategies are included in CAST: off-line and on-line (Rasconi et al. 2006b). The off-line strategy includes two planning tools, long-term and mid-term schedulers, which are designed to plan the targets to be observed within a time interval according to the hard constraints that can be predicted. The on-line strategy considers a short-term scheduler that takes into account all constraints and adapts the previously computed mid-term plan to the immediate circumstances (Rasconi et al. 2006a). Table 2 summarizes the constraints considered by each of the three schedulers. Their combination is illustrated in Fig. 2 and we provide additional details on the three scheduling tools in Sect. 2.3.

## 2.3. Genetic algorithm for the off-line strategy

The long-term and the mid-term schedulers use a MOEA to plan the science observations by promoting the soft constraints defined for each scheduler. The MOEA process, as a GA, is generally based on selection, reproduction, and mutation processes. This paradigm makes it possible to explore all regions of the parameter space, which is a vast area with a large amount of potential solutions, in search of the best solutions. These kinds of algorithms begin with a set of initial solutions that are improved through an iterative cycle based on evaluating, selecting, recombining, and mutating them. The key aspect to finding high
<figure><img src="image_3.png" /><figcaption>**Fig. 2.** Combination of the three schedulers of CAST. The long-term scheduler plans observations with a time scope of several months ($m_1$) and is recomputed after a specific number of months ($m_2$). The mid-term scheduler is executed daily and computes the observations to be performed during each night. The short-term scheduler is executed during the night after every exposure and computes the next optimal observation and an alternative ranked list of alternatives. In this work, we set $m_1 = 6$ and $m_2 = 3$ months.</figcaption></figure>

<table><caption>**Table 2.** Constraints used by the CAST long-term, mid-term, and short-term schedulers.</caption><thead><tr><th>Constraint</th><th>Long-term</th><th>Mid-term</th><th>Short-term</th></tr></thead><tbody><tr><td colspan="4">Hard constraints</td></tr><tr><td>Night</td><td>√</td><td>√</td><td>√</td></tr><tr><td>Elevation</td><td>√</td><td>√</td><td>√</td></tr><tr><td>Moon influence</td><td>√</td><td>√</td><td>√</td></tr><tr><td>Visibility duration</td><td>√</td><td>√</td><td>√</td></tr><tr><td>Pointing</td><td>√</td><td>√</td><td>√</td></tr><tr><td>Overlapping</td><td>√</td><td>√</td><td>√</td></tr><tr><td>Overhead time</td><td>√</td><td>√</td><td>√</td></tr><tr><td>Environmental conditions</td><td></td><td></td><td>√</td></tr><tr><td colspan="4">Soft constraints</td></tr><tr><td>Observing time</td><td></td><td>√</td><td>√</td></tr><tr><td>Observation deviation</td><td></td><td>√</td><td>√</td></tr><tr><td>Observing cadence</td><td>√</td><td></td><td></td></tr></tbody></table>

quality solutions lies in the definition and design of individual representation, the genetic operators, and the objectives to be optimized (Goldberg 2002; Garcia-Piquer 2012). More details about the design of a MOEA are provided in Appendix B. The MOEA applied is based on the NSGA-II procedure (Deb et al. 2002), which is one of the most well-known MOEAs. However, with the aim of obtaining a suitable optimization solution, it is necessary to design ad hoc parts of the algorithm according to the problems to be solved, so the long-term and mid-term schedulers have some differences.

### 2.3.1. Long-term scheduler

The long-term scheduler plans object observations with a timescale of several months. It takes into account the *night*, *elevation*, *moon influence*, and *visibility duration* constraints. A procedure based on MOEAs is applied to identify the best nights when each object should be observed by optimizing the soft constraint regarding the *observing cadence* constraint. The resulting plan provides a list of potential observation dates for each object assuming that all scheduled nights for the survey are suitable. Besides, the long-term scheduler is run periodically to account

for previous observations, thus counteracting any effect that unpredicted bad weather may have on the optimization. The execution of this scheduler is not time critical because it is run daily before the start of telescope operations and without interaction with the instrument control system to retrieve weather information. Therefore, it can be used as a stand-alone planning tool for any observatory.

The design of the MOEA used in the long-term scheduler is defined as follows:

- The individual genotype uses a binary encoding that represents whether the target is planned on a given night. Each individual consists of $\overline{N}$ genes {$o_1, \dots, o_{\overline{N}}$}, where $\overline{N}$ is the cardinality of the set of nights ($N$) that the long-term scheduler considers (e.g., the number of nights in three months) and $o_i$ corresponds to night $i$. Moreover, the $o_i$ value has to be 0 or 1, where 0 indicates that the target is not planned in the corresponding night and 1 indicates that the target is planned. The order of the targets in the genotype indicates a temporal sequence from the first night to the last night considered. The initial population is built by creating $N_I$ new individuals assigning to each allele a value of 0 or 1 with a probability of 0.5. This representation does not allow unfeasible individuals.

- The selection, crossover, and mutation operators are described in Appendix B.2. In the case of the long-term scheduler, a mutated gene $g'$ is obtained by negating $g$ (i.e., alleles that are 0 become 1 and those that are 1 become 0).

- The long-term scheduler has the optimization goal of identifying the nights when an object should be observed according to the *observing cadence* constraint. In the case of CARMENES, it is desirable to observe the targets when they are near their culmination. The optimization objectives promote the observation of an object near meridian crossing at the same time that maximizes the number of observations carried out. Thus, two objective functions are defined: $F_c$ promotes the observations of an object near meridian crossing and $F_n$ promotes the number of observations of the object, as described by Eqs. (1) and (2), respectively. Where $O$ is the set of nights when target $t$ is observed, $N$ is the set of genes of the individual chromosome (i.e., the number of nights to be planned); $Z_{min}(t)$ computes the minimum zenith angle that target $t$ can achieve; $Z_{min}(t, n)$ computes the minimum zenith angle that target $t$ can achieve in night $n$; and
$\overline{\overline{O}}$ and $\overline{\overline{N}}$ are the numbers of elements (cardinality) in sets O and N, respectively (i.e., the number of nights when a target is observed and the total number of nights in the planning). The parameters $F_c$ and $F_n$ have normalized values between 0 and 1 and they are optimized when minimized, i.e.,

$$F_c(O, t) = 1 - \frac{1}{\overline{\overline{O}}} \cdot \left( \sum_{o \in O} \frac{Z_{\min}(t)}{Z_{\min}(t, o)} \right); \quad (1)$$

$$F_n(N, O) = 1 - \frac{\overline{\overline{O}}}{\overline{\overline{N}}} \cdot \quad (2)$$

- We consider that the most suitable solution is the individual that has the lower average of objectives from all the individuals in the first Pareto front, i.e., non-dominated individuals; the defined objectives have to be minimized to be optimized.

### 2.3.2. Mid-term scheduler

The mid-term scheduler plans the observations that should be executed during a specific night by optimizing the observing time and observation deviation soft constraints, and according to the results of the long-term plan. Moreover, the resulting mid-term plan fulfills all the hard constraints that are predictable: night, elevation, moon influence, visibility duration, pointing, overlapping, and overhead time. The execution of this scheduler is not time critical because it can be run before the start of the nightly telescope operation, and therefore, a GA is used to obtain a near-optimal plan.

The MOEA used in the mid-term scheduler is designed as follows:

- The proposed individual genotype is made up of double numbers that represent the starting time of the observation of the targets. Each individual consists of $\overline{T}$ genes {$o_1, \dots, o_T$}, where $\overline{T}$ is the cardinality of the set of targets to be planned (T), and $o_i$ corresponds to target i. Moreover, the $o_i$ value has to be between the range [$w_{st}, w_{et} - d_t$], where w is a random uniform window in $W_t$, which are all the visibility windows in the night for target t; $w_{st}$ is the Julian day of the starting time of window w for target t; $w_{et}$ is the Julian day of the ending time of window w for target t; and $d_t$ is the estimated integration time in Julian days for target t (see Appendix A.2). Moreover, $o_i$ can have a value of -1 indicating that target i does not have a starting time assigned (i.e., it is not planned). The order of the targets in the genotype does not indicate a temporal sequence, but it is only the order of the targets in the input data. The temporal sequence of targets is defined by the alleles because they indicate the starting time assigned to each target. For instance, a target in position i of the genotype can be planned in a time window previous to the time window of target i-1. The initial population is built by creating $N_I$ new individuals assigning to each allele $o_i$ a -1 value or a value in the range between [$w_{st}, w_{et} - d_t$] following a uniform distribution. The process to build each individual is based on placing the observations of the targets, selected in random order, and avoiding overlaps. In case of overlapping, the target is unplanned (i.e., a value -1 is assigned).

- Selection, crossover, and mutation operators work as Appendix B.2 shows. In the mid-term scheduler, the mutation operator alters a gene g' by changing its allele with a value inside the potential time windows of the corresponding target. Thus, a mutated gene g' changes its allele with a

random uniform value $\mu$ in the range [$w_{st}, w_{et} - d_t$] and -1 (i.e., $g' = \mu$). In this case, the crossover of two feasible individuals can generate unfeasible offspring due to overlapping and the mutation of a feasible individual can also generate an unfeasible solution. This is solved by a repairing procedure devoted to obtain feasible new individuals, as the next point explains.

- An individual represents the time windows assigned to target observations, but it does not consider the slew time between two observations. Thus, this aspect has to be considered to obtain the final planning codified by each individual. This modification can produce an unfeasible individual because it can have conflicting observations (i.e., presence of overlaps in the observations). There are two ways to obtain an unfeasible individual that requires repair during the GA process: 1) the individual is overlapping between two or more observations, and 2) there is overlapping between two or more observations when slew time is added to each observation. We may find that it is necessary to repair the individuals after the mutation process in order to obtain feasible individuals. Thus, the main idea of the repair operator is to solve all overlaps in the individual by unplanning conflicting targets. The unplanning of one target can solve overlaps between several targets.

- The optimization goal of the mid-term scheduler is to plan the selected objects according to two objectives related to the observing time and observation deviation soft constraints with the aim of minimizing the instrument idle time (time of the night during which the instrument is not acquiring scientific data) weighted with the priority completeness of the targets, and mitigating the problem of scheduling the objects that require longer observations. Consequently, the mid-term scheduler optimizes two functions. Parameter $F_w$ promotes the time scheduled for observations of objects near median crossing according also to their priority, and $F_d$ promotes a proper distribution of the observations of the objects with the same priority, as described in Eqs. (3) and (4), respectively. Where S is the set that contains the observations scheduled in the night, $o_{target}$ is a target associated to observation o, $o_{datetime}$ is the mid-time of observation o, integrationTime($o_{target}$) computes the estimated integration time in seconds of a target observation, nightduration indicates the duration of the night in seconds, priority($o_{target}$) is the priority of the target associated with observation o that is normalized according to the priorities of all targets, $Z_{min}(o_{target})$ computes the minimum zenith angle that target $o_{target}$ can achieve during the night, $Z_{min}(o_{target}, o_{datetime})$ computes the minimum zenith angle of target $o_{target}$ at the date and time $o_{datetime}$, P is the set of priorities, $S_p$ is the set that contains the observations of targets with priority p in the night, $T_p$ is the set of the targets with priority p, $S_t$ is the set that contains the observations of target t, and $\overline{P}, \overline{S_p}, \overline{T_p}, \overline{S_t}$ are the number of elements (cardinality) in sets P, $S_p$, $T_p$, and $S_t$, respectively. Parameters $F_w$ and $F_d$ have values between 0 and 1, and they are optimized when minimized, i.e.,

$$F_w(S) = 1 - \left( \frac{\sum_{o \in S} (\text{integrationTime}(o_{\text{target}}) \cdot \text{weight}(o))}{\text{night duration}} \right), \\ \text{weight}(o) = \text{priority}(o_{\text{target}}) \cdot \frac{Z_{\min}(o_{\text{target}})}{Z_{\min}(o_{\text{target}}, o_{\text{datetime}})}; \quad (3)$$
$$ 
\begin{gathered}
F_d(S) = \frac{\sum_{p \in P} stdev(S, p, \bar{p})}{\bar{\bar{P}}}, \\
\bar{p} = \frac{\bar{S}_p}{\bar{\bar{T}}_p}, \\
stdev(S_p, p, \bar{p}) = \sqrt{\sum_{t \in T_p} \frac{(\bar{S}_t - \bar{p})^2}{\bar{\bar{T}}_p - 1}}.
\end{gathered}
\quad (4) $$

- The same strategy as in the long-term scheduler is applied to select the most suitable solution (see Sect. 2.3.1).

### 2.3.3. Short-term scheduler

The short-term scheduler computes the next observation to be executed during the night by optimizing the *observing time* and *observation deviation* soft constraints and by considering all previous observations. Moreover, the selected observations fulfills all the hard constraints. Thus, this scheduler reacts to immediate conditions (weather, errors, delays, and events). Unlike the long-term and mid-term schedulers, the short-term scheduler is time critical because it has to select an observation in a short time. For this reason, in order to avoid intensive calculations, it repairs the night schedule obtained by the mid-term scheduler (Akturk & Kılıç 1999) using astronomy-based heuristics (Giuliano et al. 2007) instead of using a GA. The short-term algorithm is called after the end of an observation and its process is explained below.

First, the algorithm removes all objects whose assigned observation period ended before the current time from the mid-term plan and selects the next target. For this target, the code computes the slew time of the telescope. The target observation obtained for the mid-term plan is adapted (i.e., advanced or delayed) according to the current time, computed slew time, and integration time. This observation is only selected if it fulfills the hard constraint requirements until the end of the observation. Otherwise, it is discarded and the gap between the current time and the start of the next observation in the mid-term plan is filled. The filling process sorts all the observations that (1) are not already in the mid-term plan, (2) fulfill the hard constraints during the entire window, and (3) can be completed in the available time. This ranking is performed according to several criteria described below. Finally, the first observation in the sorted list is selected as the next observation. The filling process is repeated until the gap is filled or there are no target observations left. Each target selected by the short-term scheduler is sent to the instrument control system, and the information on the success of the observation is stored in the database for use in subsequent scheduler runs. Besides, the sorted list of objects can be provided to the operator for override in case of need. Figure 3 shows an example of the most common situation where the short-term scheduler needs to repair the mid-term plan to select the next target to be observed.

The ranking of the targets is key in the process of repairing the mid-term plan by filling a gap between the last executed observation and the next observations recommended by the mid-term plan. This ranking is based on astronomical heuristics, and the targets are sorted according to the first rule, then the second rule, and so on. The defined rules are

1. The number of times that the target is observed during the current night (smallest to largest).

2. The target is not in the remaining mid-term plan.

<figure><img src="image_4.png" /></figure>

<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /></figure>

<figure><img src="image_9.png" /><figcaption>**Fig. 3.** Examples of observation selection corresponding to time ct. The value Ot indicates an observation of target t. For simplicity, the slew time between observations is not considered. Section a represents the visibility (i.e., fulfillment of the hard constraints) and integration time of each target in minutes. The line indicates the time window where the target is visible, and the integration time of the observations in minutes is indicated in parentheses. Portions b–f present the objects planned in the mid-term plan that are available at ct. Portion b shows how the short-term scheduler discards O5 because it is not active in the mid-term plan at ct. Thereafter, O3 is shifted and starts at 17:35 because the observation ends inside its visibility period as it is visible until 18:30. Next, in c, O4 is not visible after 18:09 and it cannot be completed if it is delayed until 17:53. Thus, O4 is removed from mid-term plan. Consequently, there is a gap between 17:53 and 18:08 that is filled with one or several new observations. In this case, we assume that two new observations are executed (O6, O7). Portion d depicts how the gap is only filled until 18:04 because no visible target that is not already in the mid-term plan fits in the remaining window. O1 is advanced and it will start at 18:04 because it is visible at this time. In e, O2 is not visible until 18:22, so it cannot be advanced. The gap between 18:19 and 18:23 is filled with one or several new observations. In this case, we assume that one new observation is executed (O8). Finally, in f, O2 can start at the time scheduled by the mid-term plan. Portion g shows the observations executed by the short-term scheduler according to the process described.</figcaption></figure>

3. The priority of the target (largest to smallest).

4. The number of times that the target has been observed in the survey (smallest to largest).

5. The proximity to meridian crossing according to Eq. (3) (largest to smallest).

The main idea of this process is to fill the gaps with interesting objects at the current time, according to the times that they have been observed, their priority, and the proximity to meridian
<table><caption>**Table 3.** Genetic algorithm parameter configuration.</caption><thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody><tr><td>Long-term generations</td><td>1000</td></tr><tr><td>Mid-term generations</td><td>1000</td></tr><tr><td>N<sub>I</sub></td><td>50</td></tr><tr><td>N<sub>P</sub></td><td>100</td></tr><tr><td>p<sub>s</sub></td><td>0.4</td></tr><tr><td>p<sub>c</sub></td><td>0.9</td></tr><tr><td>p<sub>μ</sub></td><td>1/&#773;I</td></tr></tbody></table>

crossing. Rule 2 is key to fill gaps without excessively affecting the mid-term plan, which has been globally optimized.

### 3. Efficiency of CARMENES scheduling tool

In general, CAST is focused on optimizing the three soft constraints described in Sect. 2: observing time, observation deviation, and observation sequence. The first two constraints maximize the use of the telescope and the instrument while the last constraint is included as an optional condition to increase the scientific return.

In this section we run a set of simulations of the CARMENES survey with the aim of analyzing the efficiency of CAST in the use of resources. For a quantitative analysis, we have defined different metrics related to the use of the telescope and the instrument. In particular, we computed the fraction of targets that are planned by the scheduler, total number of observations, fraction of available time that the telescope is operating, fraction of time during which the instrument is performing science observations, and fraction of overhead time. In Sect. 5 we describe the impact of the observing plans optimized by CAST on the CARMENES scientific results.

#### 3.1. CARMENES configuration

To follow the real survey as close as possible, we adopted the following procedure to run CAST. The long-term scheduler has a scope of six months and is executed every three months during the survey. The mid-term scheduler is executed every day taking the observations acquired during the previous night into account. The short-term scheduler is executed “on the fly” each time a new observation is required and takes into account the mid-term plan, the observations already carried out during the night, and any variation on the weather or instrument conditions.

In terms of parametrization, the long-term and mid-term schedulers have several parameters related to the GA as explained before. Table 3 summarizes the parameter configuration used in the experiments, which are related to the number of generations of the evolutionary algorithm, the number of elements in the initial set of solutions and in subsequent generations and to the probabilities of selection, crossing, and mutation.

#### 3.2. Results

Because GAs are stochastic methods, CAST is executed 50 times with different random seeds with the aim of avoiding any bias in the results due to convergence to local minima. Hereafter, each of these executions is referred to as a trial. Table 4 summarizes the parameters of the simulations and the results of the metrics used to evaluate the efficiency of CAST.

<table><caption>**Table 4.** CAST parameters and mean values of the metrics.</caption><thead><tr><th colspan="2">CAST parameters<sup>a</sup></th></tr></thead><tbody><tr><td>Days planned</td><td>1096</td></tr><tr><td>Total targets</td><td>309</td></tr><tr><td>Total observable time</td><td>10 703.05 h</td></tr><tr><td>Unfavorable weather time</td><td>4300.23 ± 88 h</td></tr><tr><td>Available time for observations<sup>b,f</sup></td><td>(6402.81 h)</td></tr><tr><td>Execution time of CAST</td><td>23.85 ± 0.11 h</td></tr></tbody><thead><tr><th colspan="2">Metrics<sup>a</sup></th></tr></thead><tbody><tr><td>Planned targets<sup>c</sup></td><td>100 ± 0%</td></tr><tr><td>Observations done</td><td>20 827 ± 293</td></tr><tr><td>Working time<sup>d,f</sup></td><td>99.05 ± 0.06%<br>(6342.03 h)</td></tr><tr><td>Tracking time<sup>e,f</sup></td><td>84.18 ± 0.03%<br>(5338.77 h)</td></tr><tr><td>Overhead time<sup>e,f</sup></td><td>15.82 ± 0.03%<br>(1003.22 h)</td></tr></tbody></table>

**Notes.** (a) The uncertainties are computed as the standard deviation of 50 random trials. (b) Ratio of time available for observations, excluding bad weather time. (c) Percentage of the targets that are planned. (d) Ratio of time with scheduled telescope operations with respect to the available time for observations. (e) Ratio of time with respect to the working time. (f) The number of hours is indicated in parentheses.

From the simulated weather statistics, the average usable time for observations at Calar Alto is around 60% of the total night time. Observatory statistics actually indicate that ~70% of the nights are useful according to meteorological variables (Sánchez et al. 2007, 2008). However, as explained before we considered an additional up to 20% of lost time from cloudiness or technical issues. Thus, in three years, there are about 6400 h during which observations can be scheduled. The results from our simulations presented in Table 4 show that all required targets are always planned. Around 21 000 observations are scheduled, occupying ~99% of the good weather time. The breakdown of this time indicates that 84% corresponds to the telescope collecting photons and 16% is spent during slews to new positions. This means that the instrument is collecting photons during approximately 1700 h per year. Our simulations show that CAST can optimize the observing time of the telescope by selecting the best targets to observe according to environmental conditions at each time. In our simulations, the average integration time of the targets is around 14 min and we can obtain about 3.2 observations per hour of working time.

Additionally, it is important to distribute the observations of all the targets equitably. This is the second soft constraint that CAST must optimize. Figure 4 shows the number of times that each target is observed. On average, each M dwarf in the sample is observed ~67 times during the three-year survey. The standard deviation of the number of observations between targets is 3, which indicates that the resources are reasonably distributed among the different targets. Only a few of the targets have a number of observations significantly below the average, but this is because of their very limited visibility during the year (e.g., low declination and faintness). This means that all targets have a high number of observations and, if necessary, this number can still be increased if some of the targets are discarded during the initial sample clean-up (very fast rotators, active stars, spectroscopic binaries that passed our filters, etc.). On the other hand,
<figure><img src="image_10.png" /><figcaption>**Fig. 4.** Number of observations scheduled for each target. The horizontal axis represents the identifier of each one of the 309 targets used in our simulations sorted by increasing declination. Declination ranges from -21 to 83 deg in our sample. The bars show the average and standard deviation values of the 50 executions.</figcaption></figure>

<table><caption>**Table 5.** Average computing times of the three scheduler strategies in the 50 trials.</caption><thead><tr><td>Scheduler</td><td>Execution time (s)</td></tr></thead><tbody><tr><td>Long-term scheduler</td><td>1815.166</td></tr><tr><td>Mid-term scheduler</td><td>58.347</td></tr><tr><td>Short-term scheduler</td><td>0.056</td></tr></tbody></table>

the simulations with CAST could also help in the optimization of the sample since any target for which a minimum number of observations is not reached can be rejected, or upper limits to the number of observations per target can be set.

As already mentioned, CAST includes a soft constraint to define an observing scheme that maximizes planet detectability with the least number of observations. For the present work we assumed a maximum of one observation per night for any target, but a well-sampled window function of the observations may improve the detectability of signals within a range of interesting periods. This can be quantified by computing a phase dispersion parameter given a set of previous observations for the periods of interest of each target and then estimating the next best observation that optimizes such parameter (see, e.g., Freedman et al. 1994). These techniques to optimize the periodogram window function can only be applied once several observations per target are obtained.

### 3.3. Analysis of the computational performance

The computing time of the three scheduler steps with the 309 selected targets is presented in Table 5. We developed CAST in C++ language and executed the experiments with only one processor of the main computer where CAST runs in Calar Alto (Dell PowerEdge R420 rack server with two Intel Xeon CPUs E5-2430 v2 with six cores at 2.50 GHz and 16 GB of RAM). The main restriction in the scheduling process is the response of the short-term scheduler. As already explained, this is used to select the next best survey target after the end of each observation by taking into account the environmental conditions. Its execution is required to take less than 5 s to prevent telescope idle time during the calculation. This requirement is fulfilled as the short-term scheduler selects a new observation in about 56 milliseconds. The other schedulers can be executed during the day before the observations and they do not have any time restriction. Nevertheless, they produce results in a reasonable time: about 30 min and <1 min for the long-term and mid-term schedulers, respectively.

## 4. CARMENES scheduling tool in real operation

CAST has been in real operation for the CARMENES survey since September 2016. The version used includes some additional functionality that is specific to the observing program and is intended to adapt its performance to the actual working conditions. We list here some of these additional specific features that extend beyond the general design described above:

- It is possible to change the priority of an object to increase the chances that it is selected by CAST during the survey.

- It is possible to disable an object to make it unavailable for CAST.

- CAST can include the observations of telluric standard stars during the nautical twilight in the planning.

- Bright stars can also be planned during nautical twilight, thereby updating the *night* constraint of the affected objects with the desired Sun altitude.

- A parameter is available to select the maximum number of times that a target can be observed during one night.

- It is possible to assign a cadence of observations to each target to sample different periods (from days to months).

- Interesting or standard stars can be labeled as mandatory. This implies that they must be observed every night while they have this flag active. This constraint is also considered by the mid-term scheduler in two steps: 1) the Mid-term scheduler is executed only with the mandatory objects, following the same defined objective functions, and 2) the mid-term scheduler is executed a second time with the remaining objects but blocks window times where the mandatory objects have been planned. The final mid-term plan is the merging of both plans.

- The quality of the night, according to transparency conditions, can be considered. This quality can be modified during the night by the operators. There are six keywords indicating different night quality levels, i.e., excellent, good, fair, poor, very poor, and bad. When an observation is required with a night quality that is not excellent, the mid-term plan is not considered and the short-term scheduler is in charge of selecting the next observation. In this situation, the rules specified in Sect. 2.3.3 are modified as follows:

1. The proximity to meridian crossing according to Eq. (3) (largest to smallest) weighted with $R_q$ following equation:

$$R_q(t, q) = \left( \frac{t_{\text{magnitude}}}{4.2} \right)^{(q-5)}, \quad (5)$$
which relates the magnitude of an object to the quality of the night to increase the ranking of bright objects. In Eq. (5), $t_{\text{magnitude}}$ is the J-band magnitude of target *t* and *q* is the quality of the night that goes from 4 (good) to 0 (bad).

2. The number of times that the target is observed in the current night (smallest to largest).

3. The priority of the target (largest to smallest).

4. The number of times that the target has been observed in the survey (smallest to largest).

**5. Impact of efficient scheduling on the scientific return**

**5.1. Exoplanet yield simulation**

In this section we analyze the impact of our scheduler algorithms in the scientific results of the CARMENES survey. We estimate how many planets would be detected in a radial-velocity survey following our planning scheme. As described in the introduction, the CARMENES survey has been designed to discover a statistically significant sample of exoplanets orbiting M dwarfs (Quirrenbach et al. 2014). We have shown that CAST can optimize the survey to obtain over 67 observations per target distributed during the three years of operations. To evaluate the exoplanet yield, we performed a number of simulations, which are described below.

We simulated 100 hypothetical planet scenarios using the stellar properties available for our 309 potential targets in the CARMENES database; these stellar properties include right ascension, declination, magnitude, which are input parameters of the scheduling algorithms, in addition to spectral type. We used mass-luminosity relations to estimate the mass of each target. The 2MASS $K_s$-mag and distance are taken from Carm Council (Caballero et al. 2013; Alonso-Floriano et al. 2015) to derive absolute K-band magnitudes and masses are computed with calibrations from Delfosse et al. (2000).

The properties of the simulated exoplanets were estimated according to the currently available exoplanet statistics. We used functional fits instead of the tables given in papers for convenience and to reproduce approximately the expected behavior of the probability distributions with mass and period. However, these distributions should be taken with some caution given the uncertainties of planet ratio tables. The specific details for the different parameters were as follows:

- We used the mass distribution from Mayor et al. (2011), which considers planets orbiting FGK-type stars. Planet rates for M dwarfs are also provided by Bonfils et al. (2013), but they are based on a smaller sample of planets, thus with large uncertainties or only upper limits. However, since we are interested in M dwarfs, we scaled the planet rates of the largest mass bins in Mayor et al. (2011) following the statistics in Dressing & Charbonneau (2013). As a smooth approximation to the binned statistics, for our simulations we fitted an exponential function to the resulting planet rates. We considered planets with masses between 1 $M_\oplus$ and 1000 $M_\oplus$, by extrapolating the fit below 3 $M_\oplus$. We set a lower limit to the planet mass at 1 $M_\oplus$ because, although we expect that sub-Earth mass planets are very abundant, their statistical distribution is not sufficiently well constrained to enter our simulations. Furthermore, such low-mass planets are unlikely to be detectable by CARMENES.

- To assign the orbital periods, we proceeded in the same way by using the planet rates for giant and large Neptune-like planets given in Fressin et al. (2013) for simulated planets with masses above 30 $M_\oplus$, and those given by Dressing & Charbonneau (2015) for smaller planets. In this case, we fitted a second order polynomial in a log-log scale to take into account the lower probability of planets on short periods. In our simulations we assumed 0.5 days as the minimum orbital period of planets.

- The eccentricity was assumed to follow the distribution presented in Kipping (2013).

- The inclination was taken as uniformly distributed in $\sin i$, taking into account all the possible orientations of the orbital plane.

- The argument of the periastron was assumed to follow a uniform distribution between 0 and 360 deg.

- The multiplicity of exoplanets systems was adopted to follow the Kepler Objects of Interest statistics for 1135 stars (58.9% of single planet systems, 26.5% of double planet systems, 8.6% triple, 4.3% quadruple, 1.3% quintuple, 0.2% sextuple, and 0.2% heptuple). These multiplicity rates slightly underestimate the fraction of planets per star in our simulations because of geometrical effects (narrower orbital inclination range for transits as the number of detected planets increases). However, this should not affect the conclusions of our analysis. Assuming that all stars have planets, our statistics of multiple systems predicts about 1.6 planets per star, close to the range of values given by Gaidos et al. (2014) and Dressing & Charbonneau (2015). In the case of multiple systems, for our simulations we imposed a conservative minimum ratio between planet periods of 1.3 to ensure realistic configurations in terms of orbital stability.

More details on the functional relationships and assumptions are provided in Perger et al. (2017).

Our method to validate the scientific efficiency of the CARMENES survey using CAST is described as follows:

1. Firstly, we generated a planet scenario *s* as described above. For statistical significance, we simulated 100 different scenarios ($N_S$), i.e., 100 different planet realizations for each of the 309 targets ($N_T$) in the scheduling plan described in Sect. 3. As a consistency check, we compared the statistics of our planet scenarios with those in Bonfils et al. (2013), finding that planet ratios are in agreement within the error bars for the planetary mass and orbital period bins relevant for our analysis.

2. For each exoplanet scenario *s*, we applied the 50 scheduling plans ($N_R$) obtained in Sect. 3. Each scheduling trial *r* comprises three years of observations.

3. For each target, we calculated the Keplerian radial-velocity curve that would be obtained according to the exoplanet scenario *s* and the observation dates of the scheduling trial *r*. In the case of multiple systems, we added the contribution of each planet linearly. We also included a white noise contribution to take into account the measurement uncertainty. In general, a precision of $1 \text{ m s}^{-1}$ was considered for all targets, except for targets fainter than $J = 8$ mag, for which the photon noise was assumed to scale with the magnitude from the fiducial value of $1 \text{ m s}^{-1}$ at $J = 8$ mag in 875 s.

4. In order to identify the planets that would be detected with CARMENES, we obtained the periodogram of the observations for each target following Zechmeister & Kürster (2009). We labeled a planet as identified when the peak of the periodogram corresponded to the period of the planet
<figure><img src="image_11.png" /><figcaption>**Fig. 5.** Histogram of the mean values of false positive detections as a function of period. The mean values are computed for the set of 5000 simulations (50 planning and 100 scenarios).</figcaption></figure>

simulated and the false alarm probability (FAP) was below the 0.1% threshold. To account for possible multiplanet systems, we subsequently computed the periodogram of the residuals subtracting the periods detected sequentially until no further significant periods were found.

5. Significant signals that did not correspond to any of the simulated planets were labeled as false positives.

6. Finally, we computed the average number of detected planets and false positive detections over all planet scenarios and scheduling trials to evaluate the efficiency on discovering planets of the simulated survey and their properties.

## 5.2. Results

We tested 100 different random exoplanet scenarios and obtained the average number of planet detections for 50 scheduling trials, thus adding to a total of 5000 simulations. In particular, we computed the average number of detected planets, the average number of detected planetary systems (considering that a system is detected if all its planets are found), and the average number of false positive detections. In order to assess the scientific return of the simulated survey, we analyzed the number of planets that we expected to detect and their properties.

Each of the scenarios contained a different number of planets orbiting the stars selected from the Carmencita database according to the adopted planet distribution functions. On average, a total of $505_{-17}^{+16}$ planets were generated for each scenario. In the absence of any noise source other than photon noise, $118_{-9}^{+9}$ planets were detected following the usual periodogram analyses (correct period and FAP < 0.1%), with $3.6_{-1.6}^{+2.4}$ planets that could be transiting. With respect to multi-planetary systems, for a total of $3.9_{-1.9}^{+1.1}$ stars all their planets were found in the periodogram. Finally, there were $17.9_{-4.9}^{+4.8}$ false-positive detections, representing a false-positive rate of about 13% on average. Figure 5 shows the distribution of false positives as a function of period. Most of these false positives correspond to the obvious one-day sampling alias and could be readily identified and discarded. The few cases of false positives with long periods were due to residual signals from eccentric planets. All this means that the planet detection method is sensitive enough to identify planets without suffering excessively from incorrect detections.

<figure><img src="image_12.png" /><figcaption>**Fig. 6.** Histogram of the radial-velocity semi-amplitude (top), planet mass (middle), and orbital period (bottom) of the generated planets in our simulations. In all panels, open bars show the average number of simulated planets for the 100 scenarios and 50 plannings for reference. The number of detected planets assuming 1 m s⁻¹ pure photon noise is shown as colored bars. Detections with 3 m s⁻¹ stellar activity jitter added to photon noise are shown in green.</figcaption></figure>

In percentage, $23.4_{-2.0}^{+1.9}$% of the generated planets were detected in our simulated survey, while the average number of multiplanetary systems found was $3.1_{-1.5}^{+1.8}$%. To understand this efficiency, one must keep in mind that a significant fraction of the simulated planets lay under the detection limit of the CARMENES instrument (in terms of radial-velocity amplitude). The top panel in Fig. 6 shows the histogram of the planet
<table><caption>**Table 6.** Mean values of the 50 executions of 100 planet scenarios assuming different levels of stellar intrinsic radial-velocity jitter ($\sigma_{\text{activity}}$).</caption><thead><tr><th>σ<sub>activity</sub><br>[m s<sup>-1</sup>]</th><th>Generated<br>planets</th><th>Detected<br>planets</th><th>Generated<br>systems</th><th>Detected<br>systems</th><th>False<br>positives</th><th>Detected<br>planets (%)</th><th>Detected<br>systems (%)</th></tr></thead><tbody><tr><td colspan="8" style="text-align: left; font-weight: bold;">All planets</td></tr><tr><td>0</td><td>505<sup>+16</sup><sub>-17</sub></td><td>118<sup>+9</sup><sub>-9</sub></td><td>126<sup>+11</sup><sub>-7</sub></td><td>3.9<sup>+1.1</sup><sub>-1.9</sub></td><td>17.9<sup>+4.1</sup><sub>-4.9</sub></td><td>23.4<sup>+1.9</sup><sub>-2.0</sub></td><td>3.1<sup>+1.8</sup><sub>-1.5</sub></td></tr><tr><td>3</td><td>505<sup>+16</sup><sub>-17</sub></td><td>28<sup>+5</sup><sub>-6</sub></td><td>126<sup>+11</sup><sub>-7</sub></td><td>0.2<sup>+2.8</sup><sub>-0.2</sub></td><td>4.8<sup>+2.2</sup><sub>-2.8</sub></td><td>5.5<sup>+1.2</sup><sub>-0.9</sub></td><td>0.2<sup>+2.5</sup><sub>-0.2</sub></td></tr><tr><td colspan="8" style="text-align: left; font-weight: bold;">Planets with K ≥ 1 m s<sup>-1</sup></td></tr><tr><td>0</td><td>174<sup>+10</sup><sub>-12</sub></td><td>110<sup>+7</sup><sub>-12</sub></td><td>26<sup>+5</sup><sub>-3</sub></td><td>6.4<sup>+2.6</sup><sub>-2.4</sub></td><td>17.9<sup>+4.1</sup><sub>-4.9</sub></td><td>63.3<sup>+3.8</sup><sub>-4.0</sub></td><td>24.2<sup>+9.1</sup><sub>-8.1</sub></td></tr><tr><td>3</td><td>174<sup>+10</sup><sub>-12</sub></td><td>28<sup>+5</sup><sub>-6</sub></td><td>26<sup>+5</sup><sub>-3</sub></td><td>0.3<sup>+5.7</sup><sub>-0.3</sub></td><td>4.8<sup>+2.2</sup><sub>-2.8</sub></td><td>16.0<sup>+3.2</sup><sub>-2.6</sub></td><td>1.3<sup>+22.7</sup><sub>-1.3</sub></td></tr></tbody></table>

radial-velocity semi-amplitudes. The average number of generated planets and those that are detected are shown as open and shaded bars, respectively. The steep decrease of the overall distribution at low amplitudes is not a physical effect, but is a consequence of the limit in planet mass at 1 $M_{\oplus}$. We find that exoplanet signals with semi-amplitudes exceeding 0.80 m s⁻¹ can be detected with 89% probability according to our simulations.

An effect to consider in M-dwarf star surveys is the impact of magnetic activity causing so-called radial-velocity jitter (Martín et al. 2006; Prato et al. 2008). In the CARMENES sample that we used in our simulations, 30% of the M dwarfs show the $H\alpha$ line in emission (see Fig. 1), which is a signpost of moderate to high activity levels (Jeffers et al. 2017). To provide a rough assessment of the potential effect of activity in the CARMENES survey, we run a set of simulations by considering an additional white noise term added in quadrature to the measurement uncertainty simulated. Although radial-velocity jitter could be larger toward more active later spectral types, as a simple approach we have taken the mean noise value of 3 m s⁻¹ reported in Perger et al. (2017). However, we recall that in our simulations the radial-velocity uncertainty is also larger for these stars because they are generally fainter. The results are also shown in Fig. 6 as green bars. As expected, the radial-velocity threshold for detecting planets increases and the number of detections is reduced to about 28 planets. This is a simple approach assuming non-correlated stellar jitter. However, a thorough analysis of radial velocities using the wide wavelength interval covered by CARMENES (0.52 µm–1.71 µm) helps to disentangle activity noise from exoplanet signals and improve the number of detections.

Figure 6 also shows histograms for the planet mass (middle) and orbital period (bottom) of the generated and detected exoplanets (both with and without activity jitter). As expected, long-period planets are more difficult to find because the reflex radial velocities of the host stars have lower amplitudes. On the other hand, almost all planets with masses above 5 $M_{\oplus}$ are above the detection threshold.

Our simulations show that the use of CAST for the planning of observations guarantees that a high percentage of the planets expected to be discovered by CARMENES could be identified. Table 6 summarizes the number and fraction of detected planets given all simulated systems and also considering the 1 m s⁻¹ threshold. The results taking into account an additional 3 m s⁻¹ activity jitter are also shown for comparison, but this is a worst-case scenario, as explained above.

Figure 7 shows the probability of planet detection in the CARMENES survey as a function of stellar mass and planet

<figure><img src="image_13.png" /><figcaption>**Fig. 7.** Probability of detection of the planets generated in CARMENES survey simulations in a semimajor axis vs. host star mass diagram. Dashed lines indicate the inner and outer habitable zone limits for 1 $M_{\oplus}$ planets given in Kopparapu et al. (2014). Contour lines for 25, 50, and 75% detection probability are shown. For this simulation, stellar activity jitter is not taken into account. If 3 m s⁻¹ jitter is added quadratically, probability is reduced by up to 50% in the worst case.</figcaption></figure>

semimajor axis only taking into account the measured radial-velocity uncertainty. The habitable zone limits coming from the calibrations given by Kopparapu et al. (2014) for 1 $M_{\oplus}$ planets are also plotted. This figure illustrates that, as expected, the probability of detection is higher for close-in planets, but still above ~25% for habitable zone planets around late-type M dwarfs. As expected, if we also consider the 3 m s⁻¹ stellar activity jitter, the detection probability is reduced (up to 50% in the worst cases). However, simultaneous observations using both CARMENES channels may help to correct this effect. This plot is a combination of planet detectability via periodogram analyses and our simulated planet rates. The noisy distribution above ~0.1 au for low-mass stars is due to small-number statistics, since the few giant planets generated by our simulations are well above the detection threshold. Thus, if giant planets are indeed formed around late-type stars (e.g., Delfosse et al. 1998; Johnson et al. 2007) they can be easily identified, even for long period orbits.
## 6. Conclusions

In this paper we show that automatic scheduling algorithms are efficient tools that help to improve the outcome from exoplanet surveys by optimizing the observation planning and execution. In particular, artificial intelligence techniques are well suited to search for optimal solutions within the large space of combinations of observations and can be adapted and generalized to any kind of survey. For the case of CARMENES, we created a scheduler, CAST, which takes into account observational constraints and distributes the telescope time amongst the different targets of the survey. We demonstrate that with the CARMENES instrument, it is possible to carry out a spectroscopic survey of a large sample of M-dwarf stars in three years. Our simulations using a list of 309 M dwarfs show that CAST optimizes the use of the instrument and can yield over 60 observations per target, fulfilling all constraints. Besides, an important advantage of using GAs in the automated scheduling process is that they guarantee a feasible, consistent, and near-optimal solution according to the constraints defined in the problem. CAST can be adapted to the needs of the astronomers in different situations during the survey and the night operation. Moreover, because it is based on a multi-objective optimization problem paradigm via multi-objective evolutionary algorithms, CAST is able to find optimal solutions with a trade-off between several criteria that can be in conflict with each other. This aspect provides an important advantage to CAST in order to guarantee the efficiency of the solutions in terms of use of resources (e.g., telescope operations) and in terms of science (e.g., planet detection).

In the absence of noise sources other than instrumental, our simulations using recently published planet distribution statistics indicate that these observations could yield ~118 exoplanets above the CARMENES detection threshold. This number should be taken with caution given the still large uncertainties of planet statistics around M dwarfs, but it could be used a reference of the planet detection efficiency. This means that about 65% of the planets causing radial-velocity semi-amplitudes larger than 1 m s⁻¹ would be detectable. As expected, the number of detectable exoplanets lowers with noisier data. Assuming a radial-velocity jitter due to stellar activity of 3 m s⁻¹ (white noise), the fraction of detectable planets decreases to ~16% for those with radial-velocity semi-amplitudes above 1 m s⁻¹, resulting in a number around 28. However, the simultaneous observation of radial velocities at optical and near-infrared wavelengths provides a means to counteract this effect and permit the disentangling of planet radial-velocity signals from stellar activity. In all cases, most of the potentially detectable planets are super-Earths with masses below 10 M⊕ and some of them are in the habitable zones of their stars.

**Acknowledgements.** We are grateful to the referee for helpful suggestions. CARMENES is an instrument for the Centro Astronómico Hispano Alemán de Calar Alto in Almería, Spain. CARMENES is funded by the German Max-Planck-Gesellschaft (MPG), the Spanish Consejo Superior de Investigaciones Científicas (CSIC), the European Union through FEDER/ERF funds, and the members of the CARMENES Consortium (Max-Planck Institut für Astronomie, Instituto de Astrofísica de Andalucía, Landesfernwarte Königstuhl, Institut de Ciències de l'Espai, Institut für Astrophysik Göttingen, Universidad Complutense de Madrid, Thüringer Landesfernwarte Tautenburg, Instituto de Astrofísica de Canarias, Hamburger Sternwarte, Centro de Astrobiología, and the Centro Astronómico Hispano-Alemán), with additional contributions by the Spanish Ministry of Economy, the state of Baden-Württemberg, the German Science Foundation (DFG), the Klaus Tschira Stiftung, and by the Junta de Andalucía. We acknowledge financial support from the Spanish Ministry of Economy and Competitiveness (MINECO) through grants ESP2013-48391-C4-1-R, ESP2014-57495-C2-2-R,

AYA2014-54348-C3-1-R and AYA2014-54348-C3-2-R. A.R. acknowledges support from the European Research Council under the FP7 Starting Grant agreement number 279347 and from DFG grant RE 1664/9-1.

## References

Akturk, M. S., & Kılıç, K. 1999, *J. Intelligent Manufacturing*, **10**, 387

Alonso-Floriano, F. J., Morales, J. C., Caballero, J. A., et al. 2015, A&A, **577**, A128

Astudillo-Defru, N., Bonfils, X., Delfosse, X., et al. 2015, A&A, **575**, A119

Bacardit, J. 2004, Ph.D. Thesis, Enginyeria i Arquitectura La Salle, Universitat Ramon Llull, Barcelona

Bonfils, X., Lo Curto, G., Correia, A. C. M., et al. 2013, A&A, **556**, A110

Brown, T. M., Baliber, N., Bianco, F. B., et al. 2013, PASP, **125**, 1031

Burt, J., Holden, B., Hanson, R., et al. 2015, J. Astron. Telesc., Instrum. Syst., **1**, 044003

Caballero, J. A., Cortés-Contreras, M., Alonso-Floriano, F. J., et al. 2013, in Protostars and Planets VI, Heidelberg, July 15–20, Poster #2K020

Cesta, A., Cortellessa, G., Fratini, S., & Oddi, A. 2009, in The 6th Int. Workshop on Planning and Scheduling for Space, IWPSS-09

Civeit, T. 2013, in Proc. 2013 IEEE Aerospace Conf., 298

Coello Coello, C. A. 1999, *Knowledge and Information Systems*, **1**, 269

Coello Coello, C. A. 2001, in Evolutionary Multi-Criterion Optimization, eds. E. Zitzler, L. Thiele, K. Deb, C. A. Coello, & D. Corne (Springer), Lect. Notes Comput. Sci., 1993, 21

Coello Coello, C. A., Lamont, G. B., & Veldhuizen, D. A. V. 2007, Evolutionary algorithms for solving multi-objective problems (Springer)

Colomé, J., Colomer, P., Guàrdia, J., et al. 2012, in Proc. SPIE, **8448**, E11

Cosentino, R., Lovis, C., Pepe, F., et al. 2012, in Proc. SPIE, **8446**, E1V

Deb, K., Pratap, A., Agarwal, S., & Meyarivan, T. 2002, *IEEE Transactions on Evolutionary Computation*, **6**, 182

Delfosse, X., Forveille, T., Mayor, M., et al. 1998, A&A, **338**, L67

Delfosse, X., Forveille, T., Ségransan, D., et al. 2000, A&A, **364**, 217

Delfosse, X., Bonfils, X., Forveille, T., et al. 2013, A&A, **553**, A8

Donati, A., Reinhold, B., Martinez-Heras, J. A., & Policella, N. 2012, in The 12th International Conference on Space Operations

Dressing, C. D., & Charbonneau, D. 2013, ApJ, **767**, 95

Dressing, C. D., & Charbonneau, D. 2015, ApJ, **807**, 45

Dumusque, X., Santos, N. C., Udry, S., Lovis, C., & Bonfils, X. 2011a, A&A, **527**, A82

Dumusque, X., Udry, S., Lovis, C., Santos, N. C., & Monteiro, M. J. P. F. G. 2011b, A&A, **525**, A140

Espada, D., Saito, M., Nyman, L.-A., et al. 2014, in Proc. SPIE, **9149**, E1S

Freedman, W. L., Hughes, S. M., Madore, B. F., et al. 1994, AJ, **427**, 628

Freitas, A. A. 2002, Data Mining and Knowledge Discovery with Evolutionary Algorithms (Springer)

Fressin, F., Torres, G., Charbonneau, D., et al. 2013, AJ, **766**, 81

Gaidos, E., Mann, A. W., Lépine, S., et al. 2014, MNRAS, **443**, 2561

Garcia-Piquer, A. 2012, Ph.D. Thesis, Enginyeria i Arquitectura La Salle, Universitat Ramon Llull, Barcelona

Garcia-Piquer, A., Fornells, A., Bacardit, J., et al. 2014a, *IEEE Transactions on Evolutionary Computation*, **18**, 36

Garcia-Piquer, A., Guàrdia, J., Colomé, J., et al. 2014b, in Proc. SPIE, **9152**, E21

Garcia-Piquer, A., Ribas, I., & Colomé, J. 2014c, *Exp. Astron.*, **40**, 671

Giuliano, M. E., Rager, R., & Ferdous, N. 2007, in Proceedings of The International Conference on Automated Planning and Scheduling (AAAI), 160

Giuliano, M. E., Hawkins, R., & Rager, R. 2011, in The International Workshop on Planning and Scheduling for Space, IWPSS

Goldberg, D. E. 1989, Genetic Algorithm in Search, Optimization, and Machine Learning (Addison-Wesley)

Goldberg, D. E. 2002, The Design of Innovation: Lessons from and for Competent Genetic Algorithms (Norwell, MA, USA: Kluwer Academic Publishers)

Holland, J. H. 1975, Adaptation in natural and artificial systems (Ann Arbor: The University of Michigan Press)

Jeffers, S. V., Schöfer, P., Lamert, A., et al. 2017, A&A, submitted

Johnson, J. A., Butler, R. P., Marcy, G. W., et al. 2007, ApJ, **670**, 833

Kipping, D. M. 2013, MNRAS, **434**, L51

Kitching, M., & Policella, N. 2013, in The 12th Symposium on Advanced Space Technologies in Robotics and Automation

Kopparapu, R. K., Ramírez, R. M., Schottel Kotte, J., et al. 2014, ApJ, **787**, L29
Krisciunas, K., & Schaefer, B. E. 1991, PASP, 103, 1033

Martín, E. L., Guenther, E., Zapatero Osorio, M. R., Bouy, H., & Wainscoat, R. 2006, ApJ, 644, L75

Mayor, M., Pepe, F., Queloz, D., et al. 2003, The Messenger, 114, 20

Mayor, M., Marmier, M., Lovis, C., et al. 2011, ArXiv e-prints [arXiv:1109.2497]

Nonobe, K., & Ibaraki, T. 1998, Eur. J. Oper. Res., 106, 599

Osyczka, A. 1985, Design Optimization, 1, 193

Pareto, V. 1897, Course d'Économie Politique (F. Pichou, Lausanne and Paris), Vol. 2

Perger, M., García-Piquer, A., Ribas, I., et al. 2017, A&A, 598, A26

Prato, L., Huerta, M., Johns-Krull, C. M., et al. 2008, ApJ, 687, L103

Quirrenbach, A., Amado, P. J., Caballero, J. A., et al. 2014, in Proc. SPIE, 9147, E1F

Rasconi, R., Policella, N., & Cesta, A. 2006a, in Proceedings of the ICAPS Workshop on Constraint Satisfaction Techniques for Planning and Scheduling Problems, 46

Rasconi, R., Policella, N., & Cesta, A. 2006b, in Proceedings of the 17th European Conference on Artificial Intelligence (IOS Press), Frontiers in Artificial Intelligence and Applications, 141, 845

Reiners, A., Bean, J. L., Huber, K. F., et al. 2010, ApJ, 710, 432

Reiners, A., Shulyak, D., Anglada-Escudé, G., et al. 2013, A&A, 552, A103

Sánchez, S. F., Aceituno, J., Thiele, U., Pérez-Ramírez, D., & Alves, J. 2007, PASP, 119, 1186

Sánchez, S. F., Thiele, U., Aceituno, J., et al. 2008, PASP, 120, 1244

Tuomi, M., Jones, H. R. A., Barnes, J. R., Anglada-Escudé, G., & Jenkins, J. S. 2014, MNRAS, 441, 1545

Zechmeister, M., & Kürster, M. 2009, A&A, 496, 577
# Appendix A: Hard constraints computation

## A.1. Moon influence

CAST introduces the influence of the Moon on the CARMENES survey observations by means of a merit function depending on the Moon phase and the target properties. For each potential target observation o starting at time $o_{startTime}$, the minimum accepted distance to the Moon r(o) is computed as a function of the Moon phase $\phi(o_{startTime})$ (fraction of surface illuminated) following the equation,

$$r(o) = ((r_{min} - 1) \cdot \phi(o_{startTime})) + 1, \quad (A.1)$$

where the minimum distance during full Moon is set to $r_{min} = 20$ deg. For all targets farther from the Moon a hard constraint function $H_{mi}$ is computed taking into account the Moon phase and the target magnitude following the equations,

$$H_{mi}(o) = \frac{v_1(o)}{v_2(o)}, \\ v_1(o) = 1 - \frac{m_{Moon} - m(o_{target}) \cdot (\phi(o_{startTime}))^{\alpha}}{m_{Moon} - m_{min} \cdot (\phi(o_{startTime}))^{\alpha}}, \\ v_2(o) = 1 - \frac{m_{Moon} - m_{max}}{m_{Moon} - m_{min}}, \quad (A.2)$$

where $m_{moon}$ is the magnitude of the Moon (set to -12 mag), $m_{min}$ and $m_{max}$ are the minimum and maximum magnitudes of the stars in the sample, and $\alpha$ is a power scaling factor, so that observations of faint targets close to near full-moon phases have very low priority. The denominator $v_2(o)$ is a constant scaling factor (depending on the sample) to normalize the hard constraint function $H_{mi}$ (so that it can be as well used as a merit function if desired). All targets below a certain $H_{mi} \le \beta$ threshold are taken into account in the scheduler. The $\alpha$ and $\beta$ parameters introduced in these equations are calibrated following Krisciunas & Schaefer (1991) and Calar Alto sky background conditions (Sánchez et al. 2008) so that targets are always five magnitudes brighther than the sky background. We find that values of $\alpha = 10$ and $\beta = 0.8$ satisfy this criterion.

## A.2. Integration time

The estimated integration time is computed with Eq. (A.3), where $time_{max}$ is the maximum integration time, $t_0$ is the nominal integration time, $SN$ is the desired signal-to-noise ratio, $SN_0$ is the nominal signal-to-noise ratio, $m_t$ is the magnitude of target t, and $m_0$ is the nominal magnitude. All values that do not depend on target t, can be parametrized as follows:

$$it(t) = \begin{cases} ct(t) & \text{if } ct(t) \le time_{max} \\ time_{max} & \text{if } ct(t) > time_{max}, \end{cases} \\ ct(t) = t_0 \cdot \left( \frac{SN}{SN_0} \right)^2 \cdot 10^{\frac{m_t - m_0}{2.5}}. \quad (A.3)$$

Reference values for this equation were computed from real CARMENES survey observations reaching $SN \sim 150$, from which radial velocities can be derived with uncertainties at the level of 1 m s⁻¹ (Reiners et al. 2010). The exposure time calibration as a function of J-band magnitude yields $SN_0 = 150$ for a $m_0 = 8$ mag star (J band) with and exposure time $t_0 = 875$ s. The maximum exposure time set for any target is $time_{max} = 30$ min to avoid biasing the barycentric correction.

## A.3. Pointing

The dome of the 3.5 m telescope at the Calar Alto Observatory has a “segmented” hatch. These segments allow five open window configurations with the following apertures:

- Window 1: 9 deg–31 deg.

- Window 2: 26 deg–46 deg.

- Window 3: 42 deg–62 deg.

- Window 4: 58 deg–78 deg.

- Window 5: 73 deg–92 deg.

The scheduling algorithm takes into account this configuration of dome apertures and makes sure that the window does not obscure the aperture during the integration. This is carried out by computing in advance the path of the target on the sky and the tracking of the dome during the observation. If the hatch must be moved for a particular target, this target is moved to another time slot and a different target is chosen.

## A.4. Overhead time

Equation (A.4) describes how to compute the prediction of the time gap ($H_{not}$) between the end of an observation and the beginning of a new observation, where $o_1$ is the completed observation, $o_2$ is the next observation, $ost$ is the overhead slew time for stabilization defined by the instrument properties, $rot$ is the readout time of the observation, and $st$ is the slew time of the telescope that is computed by adding the time needed to move the dome ($dt$), hatch ($ht$) and telescope ($tt$) from the target of $o_1$ to the target of $o_2$.

$$H_{not}(o_1, o_2) = \begin{cases} st(o_1, o_2), & \text{if } st(o_1, o_2) \ge rot(o_1) \\ rot(o_1), & \text{if } st(o_1, o_2) < rot(o_1), \end{cases} \\ st(o_1, o_2) = ost + dt(o_1, o_2) + ht(o_1, o_2) + tt(o_1, o_2). \quad (A.4)$$

According to instrument and observatory specifications, we assume in our calculations a telescope and dome slew rate of 1 degree per second, an stabilization overhead time $ost = 120$ s, and a readout time $rot = 40$ s. Finally, the dome hatch takes 60 s to change its position.

# Appendix B: Multi-objective evolutionary algorithm design

A MOEA has four main parts: the individual representation, genetic operators, objective functions, and selection of the most suitable solution. As a GA, it follows the process depicted in Fig. B.1.

## B.1. Individual representation

In a Pittsburgh-style GA, each potential solution in the genetic process is referred to as an individual (I) and its representation is based on the definition of a genotype, which is a set of genes that can have different values, named alleles (Holland 1975; Bacardit 2004). The individual genotype depends on the type of problem necessary to solve. The first step of the algorithm randomly builds $N_I$ individuals to be assigned to the population.

In NSGA-II (Deb et al. 2002), the individuals in the population are sorted in several fronts based on non-domination. The first front includes a set of non-dominated individuals according to the current population, the second front includes the individuals that are only dominated by the individuals in the first front,
<figure><img src="image_14.png" /><figcaption>Fig. B.1. Cycle followed by a GA.</figcaption></figure>

and so it continues until the last of the fronts. The individuals have a rank assigned according to the front to which they belong. Thus, individuals in the first front have a rank value of 1, individuals in the second front have a rank value of 2, and so on. For computing, if an individual is dominated or non-dominated it is necessary to assign the individual a value for each one of the objectives evaluated in the algorithm.

## B.2. Genetic operators

The GA process is roughly based on applying selection, reproduction (crossover), mutation, and replacement (Goldberg 1989; Freitas 2002) operators for several iterations, which are described as follows:

- **Selection.** $N_S$ parents are selected from the current population via a tournament selection strategy (Freitas 2002), with a selection probability $p_s$, based on rank and crowding distance. The crowding distance is a measure of how close an individual is to its neighbors according to the value of the evaluated objectives (Deb et al. 2002). Therefore, an individual is selected if the rank is lower than the others or if crowding distance is greater than the others. After selecting the parents, the crossover and mutation operators generate two offspring for each pair of parents, obtaining $N_S$ new individuals.

- **Crossover.** A crossover operator builds two new individuals from two previously selected parents. In our case, the two new individuals are obtained via a uniform crossover, which is based on assigning for each gene of the first child the allele of the same gene of the first parent or the second parent with

a probability of 0.5. The alleles of the genes of each parent not assigned to the first child are copied in the corresponding genes of the second child. Parents are crossed with a specific $p_c$ probability, which means that there are some situations where parents are not crossed and the two offspring are the parents themselves.

- **Mutation.** The mutation is applied to each gene of every new individual with a probability of $p_μ$, which means that some genes are not mutated. Usually, $p_μ$ is a low value because only few genes have to be mutated in order to make minor changes to the individual, which is the key of diversity.

- **Replacement.** The new individuals obtained after the application of the crossover and mutation operators are evaluated according to the defined objectives. Next, they are merged with the individuals of the current population in a temporal one. The temporal population is sorted in non-dominated fronts. Next, only the best $N_P$ individuals are added to the population used in the next generation. Individuals are selected based on their rank and on their crowding distance if they belong to the same front.

## B.3. Objective functions

The definition of these figures of merit (also called fitness functions) is related to the goals of the problem (i.e., the optimization to be achieved). Moreover, in order to obtain the results in a reasonable time, these functions must imply low computational cost because they are evaluated many times during the genetic process.

## B.4. Selection of the most suitable solution

When the last generation of the NSGA-II has been achieved, the algorithm returns the optimal front of the population (i.e., all the individuals that belong to the first front, which are non-dominated by any individual of the rest of the population). This means that, considering that the algorithm has converged, there is no solution that can improve any objective without penalizing the others. Thus, all individuals have a different trade-off between objectives but there is no individual better than the others. For this reason, it is necessary to add a new step at the end of the algorithm to identify the most suitable solution according to some specific criteria.