Message Boards Message Boards

Wolfram Model In cloud notebook not compiling?

Consider the following code:

ResourceFunction[
 "WolframModel"][{{x, y} -> {x, x, y}} -> {{x} -> {y, x}}, {{0, 1}, {0, 2}},{0}, {2, 2}}, 15, "FinalStatePlot"]

Hey, I was playing around with the Notebook in Wolfram Cloud and I can't get this code to evaluate or give me an output. I fail to see where there is a deliberate suppression/termination of the output. I've tried several iterations. I think I have the wrong bracket notation which is leading to a lack of output for this model.

Any ideas?

https://youtu.be/FPEPFHSY5z0

POSTED BY: John Lasheras

You're right that it should give you some output, but it would still be an error...

The first problem is that you're using a Free-form Input cell (indicating by the = on the left), but what you really want is an Input cell (to enter Wolfram Language code). You can get that by just typing in the notebook (while the cursor is between cells or at the beginning or end of the notebook, i.e. at a cell insertion point), by clicking Wolfgram Language Input in the cell insertion menu, or by pressing Alt+9 (Windows) or Cmd-9 (Mac).

Free-form input (which you get by pressing = once) is meant for linguistic queries like you would make on Wolfram|Alpha. There's also the very similar Wolfram|Alpha Query cell type (==), with the main difference being that the latter returns a complete result page (like you would see on Wolfram|Alpha) whereas the former only gives the Wolfram Language representation (usually an Entity) of the result. Neither of them are meant for entering formal Wolfram Language code.

Once you use a regular Input cell, you'll see that your code

ResourceFunction[ "WolframModel"][{{x, y} -> {x, x, y}} -> {{x} -> {y, x}}, {{0, 1}, {0, 2}},{0}, {2, 2}}, 15, "FinalStatePlot"]

still doesn't evaluate fully but shows a syntax error. That's because of mismatched braces, as you already suggested. I guess what you mean is

ResourceFunction["WolframModel"][{{x, y} -> {x, x, y}} -> {{x} -> {y, x}},
    {{0, 1}, {0, 2}, {0}, {2, 2}}, 15, "FinalStatePlot"]

which does give a nice result: WolframModel computation

See the documentation for the WolframModel function for more information on the argument structure.

Hope this helps. Enjoy exploring the Wolfram Language and the universe using the Wolfram Cloud!

POSTED BY: Jan Poeschko
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract