RR. Block Model Example
All the key steps for creating and validating a common Reserves Model based on multiple block models, as well as instructions for mapping fields, adding variables and checking results, see below.
Creating new Reserves Model
Click the New button to open the Reservable Models Generator window.
Import your Block Model (for this tutorial start with “pit1a”).
supported formats are:
.csv
.bmf (Vulcan)
.bintab
.dat (MineSight)
.mdl (Surpac)
.dat (Micromine)
3. Select “pit1a.csv” from your training dataset.
4. Import CSV File window will open, where you are prompted to specify where the header is and where the data starts from.
Set the green Header Line to match the header text.
Set the yellow Data Offset to match the first row of data. Sometimes when adding CSV files exported from Surpac you may have title and few description fields at the top, it’s where the Data Offset feature becomes handy.
Press OK if no changes required or adjust header and data offsets when necessary.
When importing Block Model CSV, you’ll see a preview of the first 100 rows of this CSV. It's a good time-saving feature, as your site Block models CSVs can be of a very large size and take a long time to open.
Reservable Model Generator Overview
Once you complete an import, in the Reservable Model Generator window you’ll see:
List of imported Block Models.
All the fields contained in the imported Block Model listed on a right hand side, as well as feature to create and choose Custom Variable, that can be missing, but required for mapping to one of the fields.
Default fields that every single Reserves model needs to have.
Minimum and Maximum columns to clamp numbers by block to be >= Minimum and <= Maximum.
Format selection column.
Mapping fields to be populated.
List of errors without resolving which you will not be able to generate your Reserves model.
Row Parcel Mappings template.
Buttons to Generate Reserves Model or Cancel changes made.
Basic Default Fields Mapping
Once the block model has loaded, its header fields are listed in the Variables panel on the right.
To map variables to the fields you can:
manually type it in,
drag and drop,
double click.
X, Y and Z are blocks coordinates.
DX, DY and DX are blocks dimensions.
For the Volume field use the formula N("DX")*N("DY")*N("DZ").
For the DryTonnes field use the formula N("DX")*N("DY")*N("DZ")*N("SG").
For the WetTonnes field use the formula N("DX")*N("DY")*N("DZ")*N("SG")/0.95 or N("DX")*N("DY")*N("DZ")N("SG")(1+N("moi")).
Numeric fields use the N(“field”) syntax, and text fields use the T(“field”) syntax.
Generating Reserves Model
To check if the values are correct, generate a preliminary basic Reserves Model by hitting Generate button.
Upon completion Reservable Model Generator window will close and you’ll be directed back to the main Block Model page, where you can see:
Reserves model based on a single Block Model.
Path to the folder where it is stored.
Count of blocks and model extents.
Summary with populated fields and materials grouped as “rock” (as specified Parcel).
Editing Reserves Model
Press Edit button to come back to the Reservable Model Generator and input additional information.
Adding Grades
To add new fields use the Add Additive (Sum), Add Weight Averaged (Weighted) and Add Text (Class) Icons located in the top button ribbon. These add new rows into the field list.
Add Additive - Sum fields - summed together, such as volumes, tonnes, and gold ounces.
Add Weight Averaged - Weighted fields - weight-averaged by their parent field, such as iron percent or gold ppm.
Add Text - Class fields - create subtotals of their parent fields, such as tonnes of Indicated / Inferred / Measured.
Since all grades are weight averaged by Dry tonnes, add three weight-averaged fields “Head_Fe”, “Head_Al” and “Head_Si” and map corresponding fields to them.
Creating Ore and Waste parcels using “IF” statement
To make different parcels and define Ore and Waste use the “IF” statement N("<...>") <= 0 ? 0 : N("<...>")
.
Different formulas and operators that you use to create Block Model fields expressions can be found in the RR. Block Model Formulas section.
Type in a condition or the statement to test, which will be N(“Fe”) greater than (“>”) 60 return (“?”) “ore” otherwise (“:”) call it “waste”.
2. Regenerate Reserves Model (override existing one).
3. Review grades in the Reserves Summary.
4. Use Min/Max toggle to display minimum and maximum values.
Creating Ore and Waste parcels using Custom Variables
Normally Ore and Waste definitions are more complex and multiple grades and types inputs are required. In this case, use Custom Variable functionality to define different properties through the Script Editor. Scripting language is C#.
Return to the Reservable Model Generator by pressing Edit.
Press Custom Variables button at the top right corner to open Script Editor window.
There are multiple different types of variables you can create, mains are Text and Double. In this example we will practice to create a Text Variable.
3. Delete not applicable rows (in this example, lines from 15 to 31).
4. Define variable you wish to create (Parcel).
5. Create variable called “fe” to reference all the grades within the Block Model. Use semicolon to close the formula. double fe = context.N("Fe");
6. Write a simple IF statement, such as if (fe>60) return "ore"; else return "waste";
7. To check if the statement is correct, press the Compile button.
If you did a mistake, the Compile Error window will pop up, showing row and column of an error with a short description of its type.
8. Press OK to confirm changes.
9. In the list of available variables on the right you will see a new variable CustomT("CustomTextVar") in bold, map it to the Parcel field.
10. Regenerate Reserves Model (override existing one).
11. Review grades in the Reserves Summary.
Creating more detailed on the grade binning variable
Advantage of creating Custom Variable via the Script Editor is that there it’s possible to add more complicated variables.
Update the created variable by adding lines with a breakdown of parcels based on Fe content as shown below, or copy preconfigured formula from the RR. Block Model Custom Variables page.
2. Map this new custom variable to the Parcel field.
3. Regenerate Reserves Model.
4. Review grades in the Reserves Summary. Based on populated values, you should see “hg”, “mg”, “lg1”, “lg2”, “minw” and “w” parcels added.
Adding Multiple Grade Bins
Create more detailed on grade binning custom variable, consisting of two variables: Parcel (as shown above) and OreType, including Al and Si grades.
Use nested “IF” statement, and if it doesn’t satisfy any of set grade bins parcel “waste” will be returned, or
Copy and paste the code below.
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Alastri.Scripting;
using Alastri.BlockModel.Engine.CustomVariables;
public class Parcel : ITextCustomVariable
{
public string GetText(CustomVariablesContext context)
{
double fe = context.N("Fe");
if(fe > 60) return "hg";
else if(fe > 58) return "mg";
else if(fe > 57.5) return "lg1";
else if(fe > 56) return "lg2";
else if(fe > 50) return "minw";
else return "w";
}
}
public class OreType : ITextCustomVariable
{
public string GetText(CustomVariablesContext context)
{
double fe = context.N("Fe");
double al = context.N("Al");
double si = context.N("Si");
if(fe > 58)
{
if (si <= 6 && al <= 3) return "hg";
else if(si > 6 && al <= 3) return "hghs";
else if(si <= 6 && al > 3) return "hgha";
else return "bg";
}
else if(fe > 55)
{
return "bg";
}
else if(fe > 52)
{
return "lg";
}
else if(fe > 50) return "minw";
else return "w";
}
}
2. Use the Compile button to check if the statement is correct. If no errors are indicated, press OK.
3. You should see two new Custom Variables CustomT("Parcel") and CustomT("OreType"). Map in “OreType” to the Parcel field and generate new Reserves model.
4. Review Reserves Summary. You should now see all the different parcel types, since Ore has been split to High Grade, Low Grade, High Grade High Alumina, High Grade High Silica, Min Waste and Waste, etc.
5. Check what grade binning has been applied correctly by toggling Min/Mix values display.
Adding Extra Fields
So far we mapped only default block model fields and fields for Heads Fe, Al and Si. Now we can create and map additional fields for Lumps and Fines.
Add extra fields to map variables available from your Block Model.
Add a Sum (Add Additive icon) field - Fines_Volume - to calculate fines volume use inline formula N("DX")*N("DY")*N("DZ")*N("fines_pct").
Add a Sum (Add Additive icon) field - Fines_Tonnes_Dry - to calculate dry tonnes of fines use inline formula N("DX")*N("DY")*N("DZ")*N("SG")*N("fines_pct").
Add four Weight Averaged fields (Add Weight Averaged icon) - Fines_Fe, Fines_Al, Fines_Si, Fines_Pct - map corresponding numerical fields to them.
Add a Sum (Add Additive icon) field - Fines_Tonnes_Wet- to calculate wet tonnes of fines use inline formula N("DX")*N("DY")*N("DZ")*N("SG")N("fines_pct")(1+N("moi")).
Repeat for Lumps.
You can use Find and Replace functionality.
Use the Import Template button to populate preconfigured fields and mappings (available in your Sample Dataset folder).
blockmodelfields.abmf - fields.
blockmappings.abms - mappings.
Adding multiple Block Models
Press the blue plus icon to download additional Block Models you wish to combine within one Reserves Model.
Import CSV-files pit2a and pit3a from your Sample Dataset folder.
For each of the imported Block Models fields are the same. Within the Reserves Model for each of the Models you are importing in you have to have the same structure (number of fields and fields themselves). If in source models different variables or different names are uses, you can change fields mapping, but not the fields.
Copping Mappings
In “pit1a” Block Model table use <SHIFT> or <CTRL> buttons to select all or multiple fields.
Press the Copy Mappings icon at the top toolbar to copy selected mappings to the clipboard.
Pasting Mappings
Navigate to the imported “pit2a” Block Model and multi select all the empty fields to be mapped with custom variables.
Press Paste Mappings icon at the top toolbar to populate selected fields with the mapping imported.
3. Repeat for “pit3a” Block Model.
To copy and paste fields mappings between multiple Block Models you can also use <CTRL+C> and <CTRL + V> hotkeys.
Exporting Fields and Mappings
You can export created fields and all or the selected parcel mappings using the Export button at the top toolbar. Exported sets will be saved in “.abmf” (for fields) or “.abms”/”.abmm” (all/selected mappings) format.
Combined Reserves Model
Once you are satisfied with added fields and mapping for each Block Model, generate one common Reserves Model, which will combine all of the above.
Review the Reserves Summary, it will update depending on which one you click on.
If you need to validate built Reserves model against the source one, use the Export buttons to save all or the selected parcels and fields to CSV or Text format.