davidpomerenke / elm-problem-solving / Problem.Search.Dashboard

document : { problem : Problem a, searches : List Search, visuals : List Visual, problemStateToHtml : Maybe (a -> Html (Msg a)) } -> Platform.Program () (Model a) (Msg a)

Visual dashboard. We can use this as the main function in our application.

A whole appliaction could thus just look like this:

module Main exposing (..)

import Problem.Example exposing (..)
import Problem.Search.Dashboard as Dashboard exposing (Search(..), Visual(..))

main =
    Dashboard.document
        { problem = mediumEightPuzzle
        , problemStateToHtml = Just slidingPuzzleVisual
        , searches = [ UniformCost, BestFirst, Greedy ]
        , visuals = [ Scatter, Tree, TreeMap, Graph ]
        }

This is the complete code for the first example.


type Search
    = DepthFirst
    | BreadthFirst
    | UniformCost
    | Greedy
    | BestFirst
    | TreeDepthFirst
    | TreeBreadthFirst
    | TreeUniformCost
    | TreeGreedy
    | TreeBestFirst

Helper type for easily creating a visual dashboard.


type Visual
    = Scatter
    | Tree
    | TreeMap
    | Graph

Helper type for easily creating a visual dashboard.