@@ -4,48 +4,37 @@ Hello, Cyclus! [C++]
44====================
55This pages walks you through a very simple hello world example using
66|cyclus | agents. First make sure that you have the dependencies installed,
7- namely |Cyclus |, CMake, and a recent version of Python (2.7 or 3.3 +).
7+ namely |Cyclus |, CMake, and a recent version of Python (3.11 +).
88
9- First, you need to get the ``cycstub `` code. Cycstub is a skeleton code base
9+ First, you need to use ``cycstub `` to generate a skeleton code base
1010that you can use to quick-start new |cyclus | module development projects.
11- You can grab cycstub either by using git to
12- `clone the repository <https://github.com/cyclus/cycstub.git >`_ or by
13- `downloading the zip file <https://github.com/cyclus/cycstub/archive/develop.zip >`_.
14- Let's put this code in a ``tutorial `` directory and go into it.
11+ ``cycstub `` is installed with the main ``cyclus `` kernel and should be
12+ available wherever ``cyclus `` is available.
1513
16- **Getting cycstub via git: **
14+ To use ``cycstub `` to generate the skeleton for a new Facility archetype named ``TutorialFacility `` in
15+ a module named ``TutorialLibrary `` you can issue the following command:
1716
18- .. code-block :: bash
17+ .. code-block :: console
1918
20- $ git clone https://github.com/cyclus/cycstub.git tutorial
21- $ cd tutorial
19+ $ cycstub --type facility tutorial:TutorialLibrary:TutorialFacility
2220
23- **Getting cycstub via zip: **
21+ This will populate the ``tutorial `` directory with a number of files and subdirectories
22+ that should already be complete for building a new archetype. Without any changes, this archetype
23+ will not do anything, but will be a valid archetype for use in a simulation.
2424
25- .. code-block :: bash
25+ You can add additional agents to this module by calling ` cycstub ` multiple times:
2626
27- $ curl -L https://api.github.com/repos/cyclus/cycstub/zipball > tutorial.zip
28- $ unzip tutorial.zip
29- $ mv cyclus-cycstub-* tutorial
30- $ cd tutorial
27+ .. code-block :: console
3128
32- ------------
33-
34- Since cycstub is a template project everything is named ``stub ``. We need to
35- change this to reflect the name we want our new project to be called -
36- ``tutorial `` here. Cycstub comes with a renaming tool to do just this! From
37- the command line, run Python in the following way:
38-
39- .. code-block :: bash
40-
41- tutorial $ python rename.py tutorial
29+ $ cycstub --type inst tutorial:TutorialLibrary:TutorialInstitution
30+ $ cycstub --type region tutorial:TutorialLibrary:TutorialRegion
4231
4332------------
4433
4534Let's now change the behavior of the TutorialFacility's ``Tick() `` &
4635``Tock() `` member functions to print "Hello" and "World" respectively. To do
4736this, please open up the :file: `src/tutorial_facility.cc ` file in your
48- favorite text editor (vim, emacs, gedit, `notepad++ < http ://exofrills.org >`_).
37+ favorite text editor (e.g., vim, emacs, gedit, `VS Code < https ://code.visualstudio.com/ >`_).
4938Change the original functions to look like:
5039
5140**Original Tick() and Tock() in src/tutorial_facility.cc: **
@@ -71,19 +60,19 @@ install the ``tutorial`` project. This done with the install.py script.
7160The install script puts the project into your cyclus userspace,
7261``${HOME}/.local/lib/cyclus ``.
7362
74- .. code-block :: bash
63+ .. code-block :: console
7564
76- tutorial $ python install.py
65+ $ python3 install.py
7766
7867------------
7968
8069Let's run |cyclus | with the TutorialFacility! In the input directory there is
81- an :file: `example .xml `. Running |cyclus | on this file with the command
82- ``cyclus input/example .xml `` should produce the following output.
70+ an :file: `example_tutorial_facility .xml `. Running |cyclus | on this file with the command
71+ ``cyclus example_tutorial_facility .xml `` should produce the following output.
8372
84- .. code-block :: bash
73+ .. code-block :: console
8574
86- tutorial $ cyclus input/example .xml
75+ $ cyclus example_tutorial_facility .xml
8776 :
8877 .CL:CC CC _Q _Q _Q_Q _Q _Q _Q
8978 CC;CCCCCCCC:C; /_\) /_\)/_/\\) /_\) /_\) /_\)
0 commit comments