master > master: code py - schemata für rucksack
This commit is contained in:
		
							parent
							
								
									d79b10e190
								
							
						
					
					
						commit
						7cfaf253b3
					
				@ -53,7 +53,7 @@
 | 
				
			|||||||
- name: HIRSCHBERG
 | 
					- name: HIRSCHBERG
 | 
				
			||||||
  word1: 'happily ever after'
 | 
					  word1: 'happily ever after'
 | 
				
			||||||
  word2: 'apples'
 | 
					  word2: 'apples'
 | 
				
			||||||
  once: true
 | 
					  once: false
 | 
				
			||||||
- name: HIRSCHBERG
 | 
					- name: HIRSCHBERG
 | 
				
			||||||
  word1: 'happily'
 | 
					  word1: 'happily'
 | 
				
			||||||
  word2: 'applses'
 | 
					  word2: 'applses'
 | 
				
			||||||
@ -70,3 +70,34 @@
 | 
				
			|||||||
  word1: 'ANSTRENGEN'
 | 
					  word1: 'ANSTRENGEN'
 | 
				
			||||||
  word2: 'ANSPANNEN'
 | 
					  word2: 'ANSPANNEN'
 | 
				
			||||||
  once: false
 | 
					  once: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					# Beispiele für Seminarwoche 11 (Blatt 10)
 | 
				
			||||||
 | 
					# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- &rucksack_1
 | 
				
			||||||
 | 
					  name: RUCKSACK
 | 
				
			||||||
 | 
					  algorithm: GREEDY
 | 
				
			||||||
 | 
					  allow-fractional: true
 | 
				
			||||||
 | 
					  capacity: 10
 | 
				
			||||||
 | 
					  weights:
 | 
				
			||||||
 | 
					    [3, 4, 5, 2, 1]
 | 
				
			||||||
 | 
					  values:
 | 
				
			||||||
 | 
					    [8, 7, 8, 3, 2]
 | 
				
			||||||
 | 
					- <<: *rucksack_1
 | 
				
			||||||
 | 
					  algorithm: BRANCH-AND-BOUND
 | 
				
			||||||
 | 
					- name: RUCKSACK
 | 
				
			||||||
 | 
					  algorithm: BRANCH-AND-BOUND
 | 
				
			||||||
 | 
					  allow-fractional: true
 | 
				
			||||||
 | 
					  capacity: 90
 | 
				
			||||||
 | 
					  items: [
 | 
				
			||||||
 | 
					    'Sonnenblumenkerne',
 | 
				
			||||||
 | 
					    'Buchweizen',
 | 
				
			||||||
 | 
					    'Rote Beete',
 | 
				
			||||||
 | 
					    'Hirse',
 | 
				
			||||||
 | 
					    'Sellerie',
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					  weights:
 | 
				
			||||||
 | 
					    [30, 10, 50, 10, 80]
 | 
				
			||||||
 | 
					  values:
 | 
				
			||||||
 | 
					    [17, 14, 17,  5, 25]
 | 
				
			||||||
 | 
				
			|||||||
@ -28,3 +28,5 @@ options:
 | 
				
			|||||||
    show:
 | 
					    show:
 | 
				
			||||||
      # - ATOMS
 | 
					      # - ATOMS
 | 
				
			||||||
      - TREE
 | 
					      - TREE
 | 
				
			||||||
 | 
					  rucksack:
 | 
				
			||||||
 | 
					    verbose: true
 | 
				
			||||||
 | 
				
			|||||||
@ -31,7 +31,7 @@ components:
 | 
				
			|||||||
          $ref: '#/components/schemas/EnumAlgorithmNames'
 | 
					          $ref: '#/components/schemas/EnumAlgorithmNames'
 | 
				
			||||||
      additionalProperties: true
 | 
					      additionalProperties: true
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    # Command - Algorithm: Tarjan
 | 
					    # Algorithm: Tarjan
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    CommandTarjan:
 | 
					    CommandTarjan:
 | 
				
			||||||
      description: |-
 | 
					      description: |-
 | 
				
			||||||
@ -63,7 +63,7 @@ components:
 | 
				
			|||||||
                - type: number
 | 
					                - type: number
 | 
				
			||||||
                - type: string
 | 
					                - type: string
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    # Command - Algorithm: TSP
 | 
					    # Algorithm: TSP
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    CommandTsp:
 | 
					    CommandTsp:
 | 
				
			||||||
      description: |-
 | 
					      description: |-
 | 
				
			||||||
@ -83,9 +83,9 @@ components:
 | 
				
			|||||||
            items:
 | 
					            items:
 | 
				
			||||||
              type: number
 | 
					              type: number
 | 
				
			||||||
        optimise:
 | 
					        optimise:
 | 
				
			||||||
          $ref: '#/components/schemas/EnumTSPOptimise'
 | 
					          $ref: '#/components/schemas/EnumOptimiseMode'
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    # Command - Algorithm: Hirschberg
 | 
					    # Algorithm: Hirschberg
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    CommandHirschberg:
 | 
					    CommandHirschberg:
 | 
				
			||||||
      description: |-
 | 
					      description: |-
 | 
				
			||||||
@ -107,6 +107,46 @@ components:
 | 
				
			|||||||
        once:
 | 
					        once:
 | 
				
			||||||
          type: boolean
 | 
					          type: boolean
 | 
				
			||||||
          default: false
 | 
					          default: false
 | 
				
			||||||
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					    # Algorithm: Rucksack Branch & Bound
 | 
				
			||||||
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					    CommandRucksack:
 | 
				
			||||||
 | 
					      description: |-
 | 
				
			||||||
 | 
					        Instructions for execution of Branch & Bound-Algorithm for the Rucksack-Problem
 | 
				
			||||||
 | 
					      type: object
 | 
				
			||||||
 | 
					      required:
 | 
				
			||||||
 | 
					        - algorithm
 | 
				
			||||||
 | 
					        - allow-fractional
 | 
				
			||||||
 | 
					        - capacity
 | 
				
			||||||
 | 
					        - weights
 | 
				
			||||||
 | 
					        - values
 | 
				
			||||||
 | 
					      properties:
 | 
				
			||||||
 | 
					        algorithm:
 | 
				
			||||||
 | 
					          $ref: '#/components/schemas/EnumRucksackAlgorithm'
 | 
				
			||||||
 | 
					        allow-fractional:
 | 
				
			||||||
 | 
					          type: boolean
 | 
				
			||||||
 | 
					          default: false
 | 
				
			||||||
 | 
					        capacity:
 | 
				
			||||||
 | 
					          description: Maximum weight/volumed allowed in rucksack.
 | 
				
			||||||
 | 
					          type: number
 | 
				
			||||||
 | 
					          minimum: 0
 | 
				
			||||||
 | 
					        weights:
 | 
				
			||||||
 | 
					          description: Weights or volumes of each item.
 | 
				
			||||||
 | 
					          type: array
 | 
				
			||||||
 | 
					          items:
 | 
				
			||||||
 | 
					            type: number
 | 
				
			||||||
 | 
					            exclusiveMinimum: 0
 | 
				
			||||||
 | 
					        values:
 | 
				
			||||||
 | 
					          description: Value extracted from each item (e.g. monetary).
 | 
				
			||||||
 | 
					          type: array
 | 
				
			||||||
 | 
					          items:
 | 
				
			||||||
 | 
					            type: number
 | 
				
			||||||
 | 
					        items:
 | 
				
			||||||
 | 
					          description: Optional names of the items (if empty, defaults to 1-based indexes).
 | 
				
			||||||
 | 
					          type: array
 | 
				
			||||||
 | 
					          items:
 | 
				
			||||||
 | 
					            type: string
 | 
				
			||||||
 | 
					          default: []
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    # Enum Algorithm Names
 | 
					    # Enum Algorithm Names
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
@ -118,13 +158,24 @@ components:
 | 
				
			|||||||
        - TARJAN
 | 
					        - TARJAN
 | 
				
			||||||
        - TSP
 | 
					        - TSP
 | 
				
			||||||
        - HIRSCHBERG
 | 
					        - HIRSCHBERG
 | 
				
			||||||
 | 
					        - RUCKSACK
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    # Enum TSP - Optimise Mode
 | 
					    # Enum Optimise Mode
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    EnumTSPOptimise:
 | 
					    EnumOptimiseMode:
 | 
				
			||||||
      description: |-
 | 
					      description: |-
 | 
				
			||||||
        Enumeration of optimisation options for TSP
 | 
					        Enumeration of optimisation modi.
 | 
				
			||||||
      type: string
 | 
					      type: string
 | 
				
			||||||
      enum:
 | 
					      enum:
 | 
				
			||||||
        - MIN
 | 
					        - MIN
 | 
				
			||||||
        - MAX
 | 
					        - MAX
 | 
				
			||||||
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					    # Enum Rucksack mode for algorithm
 | 
				
			||||||
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					    EnumRucksackAlgorithm:
 | 
				
			||||||
 | 
					      description: |-
 | 
				
			||||||
 | 
					        Enumeration of mode for Rucksack problem
 | 
				
			||||||
 | 
					      type: string
 | 
				
			||||||
 | 
					      enum:
 | 
				
			||||||
 | 
					        - GREEDY
 | 
				
			||||||
 | 
					        - BRANCH-AND-BOUND
 | 
				
			||||||
 | 
				
			|||||||
@ -53,6 +53,7 @@ components:
 | 
				
			|||||||
        - tsp
 | 
					        - tsp
 | 
				
			||||||
        - tarjan
 | 
					        - tarjan
 | 
				
			||||||
        - hirschberg
 | 
					        - hirschberg
 | 
				
			||||||
 | 
					        - rucksack-branch-and-bound
 | 
				
			||||||
      properties:
 | 
					      properties:
 | 
				
			||||||
        log-level:
 | 
					        log-level:
 | 
				
			||||||
          $ref: '#/components/schemas/EnumLogLevel'
 | 
					          $ref: '#/components/schemas/EnumLogLevel'
 | 
				
			||||||
@ -114,6 +115,14 @@ components:
 | 
				
			|||||||
              items:
 | 
					              items:
 | 
				
			||||||
                $ref: '#/components/schemas/EnumHirschbergShow'
 | 
					                $ref: '#/components/schemas/EnumHirschbergShow'
 | 
				
			||||||
              default: []
 | 
					              default: []
 | 
				
			||||||
 | 
					        rucksack:
 | 
				
			||||||
 | 
					          type: object
 | 
				
			||||||
 | 
					          required:
 | 
				
			||||||
 | 
					            - verbose
 | 
				
			||||||
 | 
					          properties:
 | 
				
			||||||
 | 
					            verbose:
 | 
				
			||||||
 | 
					              type: boolean
 | 
				
			||||||
 | 
					              default: false
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
    # Enum LogLevel
 | 
					    # Enum LogLevel
 | 
				
			||||||
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
					    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user