////
  // Copyright (c) 2021, 2026 Contributors to the Eclipse Foundation
  //
  // This program and the accompanying materials are made
  // available under the terms of the Eclipse Public License 2.0
  // which is available at https://www.eclipse.org/legal/epl-2.0/
  //
  // SPDX-License-Identifier: EPL-2.0
////

include::_initCommon.adoc[]

== Twilight Manufacturing System: a showcase  

The first step for using {lsat} in industry is to decompose the manufacturing system into a plant by defining resources,
 peripherals, actions and the respective activities ordering.
 
In this section, we introduce the Twilight System to show a use case of {lsat} in industry. Twilight refers to a simplification version of a wafer handling sub-system 
used at ASML. This system is presented in the figure:

image::{imgsdir}/twilightsystem.png[]
 
The  *components* of a system are described by resources. Each resource consists of one or many peripherals.

The *behavior* of the system is modeled on three levels:

1. Actions: executed by peripherals.
2. Activities:  used to describe scenarios of end-to-end deterministic behavior. 
An activity consists of a set of actions and dependencies among these actions.
3. Activity sequences: used to  describe orderings of activities.

Within the respective system, the Resources are Collision Area (CA), Load Robot (LR), Conditioner (COND). 
Each resource contains usually more than one peripherals, for example resource LR is composed of three peripherals:
 the R and Z motors and the CL clamp. The motors allow LR 
to move within a certain area, whereas the CL clamp allows it to grasp/release a product.

The actions are:

1. Claim and Release resources;
2. Unclamp, Clamp, Moves.

The basic activities are: Condition and Drill, whereas those related to the moving are:
LR_PickFromInput,  LR_PickFromCond,  LR_PickFromDrill,  LR_PutOnCond,  LR_PutOnDrill
UR_PickFromCond, UR_PickFromDrill,  UR_PutOnCond,  UR_PutOnDrill,  UR_PutOnOutput.
 
The name of the activities can be easily connected to the respective meaning based on figure:

image::{imgsdir}/twilightactions.png[]
 

Based on the dispatching file which specifies the ordering of activities, a feasible schedule can be generated,
 which meets the constraints related to the resources and the synchronization/delays.

image::{imgsdir}/twilightscheduling.png[]
 
As explained in <<dispatching-generation>>, 
this schedule can be optimized in terms of throughput/makespan based on the information included in the CIF file. 
//The optimal schedule generated by {lsat} for the Twilight manufacturing system improves the throughput with . 
 
 
image::{imgsdir}/twilightthroughput.png[]

The figure above shows the ordering of the activities for an optimal throughput.
    
For an extensive explanation regarding the theory and the examples based on {lsat},  please refer to: 

1. https://pure.tue.nl/ws/files/111655386/20181203_Bastos.pdf[Modular Specification and Design
Exploration for Flexible Manufacturing
Systems, _PhD_, J. Bastos]

2. https://pure.tue.nl/ws/files/109096741/20181122_Sanden.pdf[Performance Analysis and Optimization of Supervisory Controllers, _PhD_, B.Sanden]