Warning, /AID2E-framework/examples/complete/workflow_example_combined_objectives.yml is written in an unsupported language. File is not indexed.
0001 # ============================================================================
0002 # DTLZ2 Multi-Objective Optimization with Combined Objectives
0003 # ============================================================================
0004 # This example shows:
0005 # 1. Combined objective: single computation produces multiple metrics (f1, f2)
0006 # 2. Scheduler cascade: global → workflow → branch → stage
0007 # 3. Clean separation: problem definition → workflow execution
0008 # ============================================================================
0009
0010 # SECTION 1: PROBLEM DEFINITION
0011 # What to optimize (objectives) and design space
0012 # ============================================================================
0013 problem:
0014 name: "DTLZ2 Multi-Objective Optimization"
0015 type: "toy"
0016 description: "Two-objective DTLZ2 test problem with combined evaluation"
0017
0018 # Design space parameters
0019 design_space:
0020 path: "examples/complete/design.params"
0021
0022 # ========================================================================
0023 # OBJECTIVES: Define what we're optimizing for
0024 # ========================================================================
0025 # This is a COMBINED objective: one execution produces BOTH f1 and f2
0026 # The script outputs: {"f1": value1, "f2": value2}
0027 # We extract each metric via "metric_key"
0028 objectives:
0029 - name: "dtlz2_pareto"
0030 direction: "minimize" # This applies to the combined objective as a whole
0031
0032 # Objective plan: HOW to compute the objective(s)
0033 objective_plan:
0034 steps:
0035 stages:
0036 - name: "evaluate_objectives"
0037 script:
0038 path: "examples/complete/scripts/dtlz2_problem.py"
0039 output_file: "objectives.json"
0040 timeout_sec: 600
0041 produces_objective: true
0042
0043 # Metrics: Extract multiple values from ONE objective_plan execution
0044 # Instead of running the script twice (once for f1, once for f2),
0045 # we run it once and extract both metrics from the output
0046 metrics:
0047 - name: "f1"
0048 direction: "minimize"
0049 metric_key: "f1" # Extract the "f1" key from output JSON
0050
0051 - name: "f2"
0052 direction: "minimize"
0053 metric_key: "f2" # Extract the "f2" key from output JSON
0054
0055 # SECTION 2: SCHEDULER CONFIGURATION
0056 # How to run computations (global defaults)
0057 # ============================================================================
0058 scheduler:
0059 runner_type: "JobLibRunner"
0060 parameters:
0061 n_jobs: 4 # Use 4 parallel jobs by default
0062 backend: "loky" # Use process-based parallelism
0063
0064 # SECTION 3: WORKFLOW EXECUTION
0065 # How to execute the optimization (stages, parallelism, etc.)
0066 # ============================================================================
0067 workflows:
0068 - name: "dtlz2_optimization"
0069 description: "DTLZ2 evaluation workflow"
0070
0071 # Workflow-level scheduler (overrides global scheduler)
0072 scheduler:
0073 runner_type: "JobLibRunner"
0074 parameters:
0075 n_jobs: 8 # Use 8 jobs for this workflow
0076 backend: "loky"
0077
0078 # Branches: parallel execution paths
0079 branches:
0080 - name: "main"
0081 description: "Main evaluation branch"
0082
0083 # Branch-level scheduler (overrides workflow scheduler)
0084 scheduler:
0085 runner_type: "JobLibRunner"
0086 parameters:
0087 n_jobs: 2 # Use 2 jobs for this branch
0088 backend: "loky"
0089
0090 # Stages: sequential computation steps
0091 stages:
0092 - name: "evaluate_objectives"
0093 description: "Evaluate DTLZ2 objectives for design points"
0094
0095 # Individual jobs for this stage
0096 jobs:
0097 - name: "dtlz2_eval"
0098 command: "python examples/complete/scripts/dtlz2_problem.py"
0099 outputs:
0100 - path: "objectives.json"
0101 format: "json"
0102
0103 # Job factory: expand one job into many parallel copies
0104 # Creates 4 parallel job instances (one per design point)
0105 job_factory:
0106 type: "range"
0107 params:
0108 n: 4
0109
0110 # Parallelism policies for this stage
0111 parallelism:
0112 max_concurrent: 4 # Run max 4 jobs in parallel
0113 retry_max: 2 # Retry failed jobs up to 2 times
0114 timeout_sec: 300 # Kill job if it takes >300 seconds
0115
0116 # Stage-level scheduler (overrides branch scheduler)
0117 scheduler:
0118 runner_type: "JobLibRunner"
0119 parameters:
0120 n_jobs: 4 # Stage can override branch's n_jobs=2
0121 backend: "loky"
0122
0123 # Output artifacts
0124 outputs:
0125 - path: "objectives.json"
0126 format: "json"