{-|
Configurations might work for @PetriGraphToMath@ and @PetriMathToGraph@ tasks
-}
module Modelling.PetriNet.PetriGraphToMath.Config where

import Modelling.PetriNet.MatchToMath (
  MathConfig (..),
  )
import Modelling.PetriNet.Types (
  AdvConfig (..),
  AlloyConfig (..),
  BasicConfig (..),
  ChangeConfig (..),
  GraphConfig (..),
  )

import Control.OutputCapable.Blocks     (ExtraText (..))
import Data.GraphViz.Commands           (GraphvizCommand(..))

{-|
points: 0.15
average generation time per instance: 4:00min
CPU usage: 110%
-}
task2023_17 :: MathConfig
task2023_17 :: MathConfig
task2023_17 = MathConfig {
  basicConfig :: BasicConfig
basicConfig = BasicConfig {
    places :: Int
places = Int
5,
    transitions :: Int
transitions = Int
7,
    atLeastActive :: Int
atLeastActive = Int
3,
    flowOverall :: (Int, Int)
flowOverall = (Int
13, Int
15),
    maxTokensPerPlace :: Int
maxTokensPerPlace = Int
2,
    maxFlowPerEdge :: Int
maxFlowPerEdge = Int
1,
    tokensOverall :: (Int, Int)
tokensOverall = (Int
10, Int
10),
    isConnected :: Maybe Bool
isConnected = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
True
    },
  advConfig :: AdvConfig
advConfig = AdvConfig {
    presenceOfSelfLoops :: Maybe Bool
presenceOfSelfLoops = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
False,
    presenceOfSinkTransitions :: Maybe Bool
presenceOfSinkTransitions = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
False,
    presenceOfSourceTransitions :: Maybe Bool
presenceOfSourceTransitions = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
True
    },
  changeConfig :: ChangeConfig
changeConfig = ChangeConfig {
    tokenChangeOverall :: Int
tokenChangeOverall = Int
0,
    maxTokenChangePerPlace :: Int
maxTokenChangePerPlace = Int
0,
    flowChangeOverall :: Int
flowChangeOverall = Int
2,
    maxFlowChangePerEdge :: Int
maxFlowChangePerEdge = Int
1
    },
  generatedWrongInstances :: Int
generatedWrongInstances = Int
300,
  graphConfig :: GraphConfig
graphConfig = GraphConfig {
    graphLayouts :: [GraphvizCommand]
graphLayouts = [GraphvizCommand
Sfdp],
    hidePlaceNames :: Bool
hidePlaceNames = Bool
False,
    hideTransitionNames :: Bool
hideTransitionNames = Bool
False,
    hideWeight1 :: Bool
hideWeight1 = Bool
True
    },
  printSolution :: Bool
printSolution = Bool
True,
  useDifferentGraphLayouts :: Bool
useDifferentGraphLayouts = Bool
False,
  wrongInstances :: Int
wrongInstances = Int
3,
  alloyConfig :: AlloyConfig
alloyConfig = AlloyConfig {
    maxInstances :: Maybe Integer
maxInstances = Integer -> Maybe Integer
forall a. a -> Maybe a
Just Integer
2000,
    timeout :: Maybe Int
timeout = Maybe Int
forall a. Maybe a
Nothing
    },
  extraText :: ExtraText
extraText = ExtraText
NoExtraText
  }

{-|
points: 0.15
average generation time per instance: 6:00min
CPU usage: 110%
-}
task2023_18 :: MathConfig
task2023_18 :: MathConfig
task2023_18 = MathConfig {
  basicConfig :: BasicConfig
basicConfig = BasicConfig {
    places :: Int
places = Int
6,
    transitions :: Int
transitions = Int
5,
    atLeastActive :: Int
atLeastActive = Int
2,
    flowOverall :: (Int, Int)
flowOverall = (Int
15, Int
17),
    maxTokensPerPlace :: Int
maxTokensPerPlace = Int
1,
    maxFlowPerEdge :: Int
maxFlowPerEdge = Int
1,
    tokensOverall :: (Int, Int)
tokensOverall = (Int
5, Int
5),
    isConnected :: Maybe Bool
isConnected = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
True
    },
  advConfig :: AdvConfig
advConfig = AdvConfig {
    presenceOfSelfLoops :: Maybe Bool
presenceOfSelfLoops = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
True,
    presenceOfSinkTransitions :: Maybe Bool
presenceOfSinkTransitions = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
False,
    presenceOfSourceTransitions :: Maybe Bool
presenceOfSourceTransitions = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
False
    },
  changeConfig :: ChangeConfig
changeConfig = ChangeConfig {
    tokenChangeOverall :: Int
tokenChangeOverall = Int
0,
    maxTokenChangePerPlace :: Int
maxTokenChangePerPlace = Int
0,
    flowChangeOverall :: Int
flowChangeOverall = Int
2,
    maxFlowChangePerEdge :: Int
maxFlowChangePerEdge = Int
1
    },
  generatedWrongInstances :: Int
generatedWrongInstances = Int
300,
  graphConfig :: GraphConfig
graphConfig = GraphConfig {
    graphLayouts :: [GraphvizCommand]
graphLayouts = [GraphvizCommand
Fdp],
    hidePlaceNames :: Bool
hidePlaceNames = Bool
False,
    hideTransitionNames :: Bool
hideTransitionNames = Bool
False,
    hideWeight1 :: Bool
hideWeight1 = Bool
True
    },
  printSolution :: Bool
printSolution = Bool
True,
  useDifferentGraphLayouts :: Bool
useDifferentGraphLayouts = Bool
False,
  wrongInstances :: Int
wrongInstances = Int
3 ,
  alloyConfig :: AlloyConfig
alloyConfig = AlloyConfig {
    maxInstances :: Maybe Integer
maxInstances = Integer -> Maybe Integer
forall a. a -> Maybe a
Just Integer
2000,
    timeout :: Maybe Int
timeout = Maybe Int
forall a. Maybe a
Nothing
    },
  extraText :: ExtraText
extraText = ExtraText
NoExtraText
  }

{-|
points: 0.1
average generation time per instance: 5:16min
CPU usage: 105%
-}
task2024_21 :: MathConfig
task2024_21 :: MathConfig
task2024_21 = MathConfig
task2023_17

{-|
points: 0.1
average generation time per instance: 10:28min
CPU usage: 103%
-}
task2024_22 :: MathConfig
task2024_22 :: MathConfig
task2024_22 = MathConfig
task2023_18

{-|
points: 0.05
the amount of generated instances: 100
maximum concurrent amount of tasks: 50
average generation time per instance on the cluster (without considering concurrency): 12:48min
total run time on the cluster (not including queuing time): 26:50min
average CPU usage: 101%
average max memory usage: 986.73 MB
Note: 1 student task is rendered faulty on Autotool due to the different graphviz version (manually fixed).
-}
task2025_23 :: MathConfig
task2025_23 :: MathConfig
task2025_23 = MathConfig
task2024_21

{-|
points: 0.05
the amount of generated instances: 100
maximum concurrent amount of tasks: 50
average generation time per instance on the cluster (without considering concurrency): 32:20min
total run time on the cluster (not including queuing time): 01:51:17h
average CPU usage: 100%
average max memory usage: 1255.89 MB
Note: about 15 student tasks are rendered faulty on Autotool due to the different graphviz version (manually fixed).
-}
task2025_24 :: MathConfig
task2025_24 :: MathConfig
task2025_24 = MathConfig
task2024_22