{-|
Configurations might work for @PetriGraphToMath@ and @PetriMathToGraph@ tasks
-}
module Modelling.PetriNet.PetriMathToGraph.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: 2:30min
CPU usage: 120%
-}
task2023_19 :: MathConfig
task2023_19 :: MathConfig
task2023_19 = 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
10, Int
12),
    maxTokensPerPlace :: Int
maxTokensPerPlace = Int
1,
    maxFlowPerEdge :: Int
maxFlowPerEdge = Int
1,
    tokensOverall :: (Int, Int)
tokensOverall = (Int
2, Int
4),
    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
True,
    presenceOfSourceTransitions :: Maybe Bool
presenceOfSourceTransitions = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
False
    },
  changeConfig :: ChangeConfig
changeConfig = ChangeConfig {
    tokenChangeOverall :: Int
tokenChangeOverall = Int
2,
    maxTokenChangePerPlace :: Int
maxTokenChangePerPlace = Int
1,
    flowChangeOverall :: Int
flowChangeOverall = Int
2,
    maxFlowChangePerEdge :: Int
maxFlowChangePerEdge = Int
1
    },
  generatedWrongInstances :: Int
generatedWrongInstances = Int
300,
  graphConfig :: GraphConfig
graphConfig = GraphConfig {
    graphLayouts :: [GraphvizCommand]
graphLayouts = [GraphvizCommand
Dot, GraphvizCommand
Neato, GraphvizCommand
Fdp, 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: 8:30min
CPU usage: 100%
-}
task2023_20 :: MathConfig
task2023_20 :: MathConfig
task2023_20 = 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
14, Int
16),
    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
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
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
Dot, GraphvizCommand
Neato, GraphvizCommand
Fdp, 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
True,
  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: 3:57min
CPU usage: 112%
-}
task2024_23 :: MathConfig
task2024_23 :: MathConfig
task2024_23 = MathConfig
task2023_19

{-|
points: 0.1
average generation time per instance: 9:22min
CPU usage: 107%
-}
task2024_24 :: MathConfig
task2024_24 :: MathConfig
task2024_24 = MathConfig
task2023_20

{-|
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): 11:37min
total run time on the cluster (not including queuing time): 24:47min
average CPU usage: 101%
average max memory usage: 899.33 MB
Note: No instances were rendered faulty on Autotool regardless of the different graphviz version.
-}
task2025_25 :: MathConfig
task2025_25 :: MathConfig
task2025_25 = MathConfig
task2024_23

{-|
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): 37:58min
total run time on the cluster (not including queuing time): 01:19:33h
average CPU usage: 100%
average max memory usage: 1772.93 MB
Note: 8 student tasks were rendered faulty on Autotool due to the different graphviz version (manually fixed).
-}
task2025_26 :: MathConfig
task2025_26 :: MathConfig
task2025_26 = MathConfig
task2024_24