I use Minizinc in a personal toy project (https://gitlab.com/dustin-space/meal-scheduler), and GECODE or Google's ortools solver at the backend. It's used for meal planning. Unfortunately it's way way slower than I'd hope. I suspect I just have the domain not modeled efficiently. Maybe if I had a few days to put into it, and learn how to properly debug the CSP solver step by step, it might help...
If you can extract some instances you could send in your problem to the MiniZinc challenge (https://www.minizinc.org/challenge2022/challenge.html), preferably with several instances with varying complexity. The benefit for you is that it is a good way to ensure that your particular problem is tested for a lot of solvers, and may be used for improvments of solvers in the future. The deadline for this years challenge problem submission is 6th of May.
I wrote a meal scheduler - https://gitlab.com/dustin-space/meal-scheduler. It tracks ingredients we have at home, it has a database of recipes, it knows where we can buy ingredients online (for delivery).
It schedules meals for my shared household.
I can give it a request like: "next week I want to cook 4 vegetarian meals with 3 portions, and 1 vegan meal for 8 people for big shared dinner, and I want <=2 of those to be noodles.
It thinks for a bit with a planner (implemented in Minizinc - https://www.minizinc.org/ - with OR-Tools for a solver), and out pops a plan, like: "OK, you need to check you still have 500 g of potatoes, ..., then buy 1 kg of carrots, 1 liter of coconut milk, and here's links for the online store; I also checked those ingredients in stock; I also need cayenne pepper, you'll have to get it yourself because I don't know how to get it online".
The planner can understand things like "there's risotto rice, jasmine rice, arborio rice, etc.; some recipes ask for specific type of rice but some recipes are OK with any kind of rice". And there's more things I plan to support in the future, like ingredients that allow "use this ingredient or this other ingredient", or optional ingredients.
When we get a plan, we then check we have all the needed stock, and if we don't, we update the stock and replan. And when it's done, it generates an ICS file with calendar entries we add to our shared calendar ("today we're cooking gnocchi with pesto for 4 people, here's link to the recipe"). It also generates stickers, which you print on sticker paper, and you put them on the ingredients that will be needed to cook. The stickers ensure someone doesn't accidentally eat too much of them before we need them.
It's given us a lot of utility for our household. It lets us make tasty fancy meals without the toil of planning. It's quite rough around the edges - no fancy UI, lots of "you have to enter this textproto here and there's next to no validation". But I'm slowly improving it in my spare time to make it more convenient and useful for us.
Right now, the published part of it is not useful, it only includes like 8 recipes that we manually entered. But I'm trying to design it so that it can eventually be a platform, and ideally easy-ish to use for households.
That sounds like a fun application, both the usage and the implementation.
I wonder if you have any interesting example data-files that could be used with the model, preferable both something small and something larger? Would be fun to test the model locally to see how it behaves.
Unfortunately the model is wildly unoptimized. You can extract small minizinc inputs by `blaze test //plan:wrapper_test` which tests the model on simple use cases, the temporary files will go to `--test_tmpdir`.
I don't have a big minizinc input on hand. In our database it takes about 2 minutes to plan for a weeks meals. The model is probably wildly inefficient and optimizing it is one thing on the long term bug list.
If you have the time, extracting a large sample would be nice. Real-world usage is always more interesting than academic examples. Something that takes around 2 minutes feels like a sweet-spot for optimization as well, long enough to matter but not long enough to be annoying to experiment with.
This is cool I have a similar thought in mind as well as far as having specific meals/ingredients to buy and suggest at random with cost for next grocery run.
Looked at the repo, any screenshots of the UI/interface?
I don't have any on hand, but it's extremely bare bones. Plain HTML, no CSS, no JavaScript. Also I don't have a permanently running server yet, I just boot it up with a sqlite db in Git when i need to use it. Might respond later with screenshots if i remember when its more convenient for me.
Yep. My creative process: "Need quick & nice fantasy-styled logo" => "Hey, I remember Wales has a dragon on its flag" => "Ooh, and Wiki Commons even has a CC0 SVG! Done."
Thanks! We agree, memory models/instruction reordering is where it gets really fun and educational. The complexity scared us and we wanted to make the game usable as soon as we could, so we rather left it on the TODO list for now. Maybe one day in V2 :)
You could add a CPU write buffer or cache lines as an intermediate step between the code and memory, and allow the player to choose when those get flushed to memory, constrained by memory barrier operations.
This kind of problem comes up very often in the context of the Linux kernel. And the ability to deal with it is as even rarer among programmers experienced with concurrency than experience with concurrency is among programmers in general. A tutorial of this form for memory ordering issues would be invaluable.
I'd be happy to help with problems and game-element design for a memory-ordering version of this tutorial.