---
# System prepended metadata

title: Orchestrator Optimizer IF
tags: [harmonic]

---

# Orchestrator Optimizer Interface

## Context
### Assumptions
* REST API in Optimizer
* Optimizer is stateless (but holds internal in-memory DB)
* Optimizer is a single Docker Image

### Discussion JKU-SWISS
![image](https://hackmd.io/_uploads/SJ_Rftl0p.png)

### Open Questions
* how does the Orchestrator provide data to Optimizer?
  * send all data for an optimization at once, or
  * continously send data and at certain times trigger optimization
* how to provide Equity Monitoring input?
  * as part of IF when sending data to Orchestrator, or
  * through access to DB from FZAG

## Data sent from Orchestrator

### Optimizer Input
```yaml=
meta:
  name: Optimization

content:
  bases:
    - name: Optimization
      attributes:
        flights: set<Flight>
        targetTimes: set<TargetTime>
        auPreferences: set<FlightPreference>
        airportPreferences: set<FlightPreference>
        initialFlightlist: set<Flightplan>
    - name: Flight
      attributes:
        flightId: string
        auId: string
        scheduledTime: DateTime
    - name: TargetTime
      attributes:
        targetTimeId: string
        time: DateTime
    - name: FlightPreference
      attributes: 
        flightId: string
        priority: integer
        weights: set<Weight>
    - name: Weight
      attributes:
        targetTimeId: string
        weight: integer
    - name: Flightplan
      attributes:
        flightId: string
        targetTimeId: string
```

edit in HTML form: [SOyA Link](https://soya-form.ownyourdata.eu/?schemaDri=Optimization&data=%7B%7D)

## Data received from Optimizer

### OptimizerOutput
```yaml=
meta:
  name: OptimizerOutput
  
content:
  bases:
    - name: OptimizerOutput
      attributes:
        optimizerOutput: set<OptimizationResult>
        
    - name: OptimizationResult
      attributes:
        result: set<FlightAssignment>
        statistic: Statistics
    
    - name: FlightAssignment
      attributes:
        flightNumber: String
        slot: String

    - name: Statistics 
      attributes: 
        resultFitness: Double 
        initialFitness: Double
        iterations: Integer
        fitnessFunctionInvocations: Integer
        timeCreated: DateTime
        timeStarted: DateTime
        timeAborted: DateTime
        timeFinished: DateTime
```