Skip to content

Getting started with the project

Max Bourgeat edited this page Jul 4, 2023 · 2 revisions

First steps

To get started with SeaPearl, you will need a basic understanding of constraint programming. If you are not familiar with it, you can head over to MiniCP's website. The 11-step tutorial explains the basics of constraint programming pretty well. As SeaPearl also uses reinforcement learning, brushing up on RL will be beneficial as well. Spinning up is a little dated, but contains all the basics you need to go deeper with RL.

Getting your hands dirty

While it's good to understand the theory, the best way to learn is always by doing. We think a very good way to understand how SeaPearl works is by stepping through the code as the solver solves a problem. To do this, follow these steps:

  1. Clone SeaPearlZoo.jl if you don't already have it
  2. Open a terminal in the SeaPearlZoo.jl root
  3. Enter the following commands:

SeaPearlZoo.jl> julia

julia> ]

pkg> activate .

pkg> instantiate

pkg> dev "[path to SeaPearl.jl root]"

  1. Then you can run the examples provided in SeaPearlZoo and put breakpoints to step through the code and understand how it works. Note that it will be very hard to understand how the solver works if you have no prior knowledge of constraint programming.

  2. You can also run the examples provided for the XCSP competition. First you will need to download the instances, secondly, you can create and set a JSON file with all the parameters needed as in this example:

{
    "bench_name": "instance_example.xml",
    "strat": "example_search_strategy",
    "csv_path": "csv_file_to_save_results.csv",
    "random_seed": 12345,
    "time_limit": 60,
    "memory_limit": 8192,
    "nb_core": 4
  }

And then you can launch the run by typing the following command

julia src/argparse_setting.jl -j "path/to/parameters/json/file.json"