Overview

You should start with one of the template processes supplied with BRAHMS. To make a copy of a template and start developing it into your own Process, use the BRAHMS Manager. Read through the BRAHMS Manager to familiarise yourself with what it can do if you are not already, then click on "New" and follow the instructions below.

Creating the new process

Make the following choices.

Language Binding
1262
Class Name
dev/quickstart/1262

We will assume that this went alright, including "Build" (if required) and "Test" - if it didn't, review the BRAHMS Manager page to try and find out what you might need to do to get it to work. Come back here when you've got the new Process built and tested successfully.

Notes
  • If necessary, you can just copy a template folder out into your Namespace (but for native processes you will have to write your own build script). This is not recommended unless you cannot use the BRAHMS Manager for some reason.

Modifying the new process

Click "Open" in the Manager to see what files are associated with your new Process. One file you will find there is your Process source file - we will modify this to change how your Process behaves. A second file there is test.m, which is the test script that was built by the BRAHMS Manager to test that your new Process installed and built correctly. We will use this file to test your Process as we modify it, so we will also be modifying this test script file. You should open the process source file in your favourite editor for the source language, and open test.m in the Matlab editor.

Modifications to these two files are shown with context, i.e. some surrounding lines of code that are already there. The modified lines, in each case, are highlighted, as shown here for a C example. We'll also use the ellipsis (three dots, "...") to indicate where we've missed out a bit of the file for brevity.

C/C++ Source Code
int a; // Here is an unchanged line.
a = 1; // Here's a deleted line.
a = 2; // This line we've added or modified.
bout << "1 == " << a << D_INFO; // But this one is unchanged.

You can run the test script at the Matlab prompt (after navigating to the folder), or by clicking "Test" in the BRAHMS Manager. Do whatever suits you best.

Renaming

If you open multiple brahms_process.py files in your editor, you may be annoyed that they are difficult to tell apart. You are free to rename any brahms_process.py to <string>.py, but you must provide a text file alongside it containing just the string <string>, and named brahms_process (no filename extension).

What doesn't it do?

The Process is currently empty, which means it does very little indeed. In particular, it doesn't do the following.

  • Generate outputs.
  • Keep state variables.
  • Take parameters.
  • Take inputs.

In the remainder of this section, we'll look into adding these features to the new Process, one by one.

Conventions

When we say "modify your source file", you can go ahead and rebuild the process (if required) and run the test script after making the mods - underneath the mods, we'll show you the output you should expect to see. Similarly, when we say "modify your test script", you can make the mods, run the script, and your output should match what we show underneath.