You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 37 Next »

Tutorial 4
Telitabs and solution management

Learning goals

  1. Modifying a dataset
  2. Performing string operations on telitabs
  3. Learn about more Quaestor funtions
  4. Managing solutions

1    Objective

In this Tutorial, we will evaluate the values of GM for each ship on the criteria stability and comfort for the crew. These criteria will be used to decide which ship is the most ideal, based on GM. Finally, we will generate one solution in which all the results of the previous tutorials are presented.

Start

For this tutorial, the knowledgebase from tutorial 3 is used. You can either use your own (verified) knowledgebase, or download it here:[Tutorial 4 Start]

2    Changing the dataset

First, we'll clean up the workbase from any solution.

Remember that we put the attributes to the object Ships? It was used to make the object a multi case entry to the database, and when the process manager was started, the contents of the object could be selected as data. For the next steps in the Tutorial, we want to use the Ships object, containing all our variations as dataset in part of a relation. As we already discussed with the Hull object, this is only possible when is can be seen as object from the entry point in the dataset. However, at this moment Ships itself is the entry point.

So to use Ships as a separate dataset we should do the following: 

  Add a new object Data to the knowledge base (see previous tutorial) and add this object to the top of the dataset, by dragging it tot the Dataset node. You will be asked where to place the object, select the list and continue. Now you have to objects, Data and Ships in the top level of Dataset;

  Now add @DBENTRY and @DBOBJECT to the object Data and remove these from the Ships object. Object Data has become your entry point;

  Now add a Ships object to the Data object by dragging the Ships object from the Knowledge Browser to the Data object in the Dataset. Now you have a Ships object in the Data object and you still have the Ships object on the top level;
  Now want to move the data in the Ships object on the top level to the Ships object in the Data object. Select the Ships object on the top level, right click ,  , and select All to clipboard (or F4). Then select the Ships object under the Data object an click on Paste. You will be asked whether or not to create new parameters, select Yes to All and continue;

  And finally you want to delete the Ships object on the top level. Select the Ships object in the tree and press DEL; 

Now we are setup to continue with the next steps of the tutorial.

3    Stability overview in one TeLiTab


We'd like to have a clear overview of the stability of all our ships. Therefore, we'll create a TeLiTab containing the contents of Ships completed with GM_rounded, a rounded value of GM, and a ship number.

   Add the following relation to the class Geometry: 

which is GM rounded to 1 decimal place in meters, also see the function ROUND(). Note that Quaestor automatically sets the number of decimal places in which a parameter should be presented in the workbase to 2. Obviously, GM_rounded should be presented with only one decimal place, which can be changed in the Slots&Properties window.

  Also, add the following relation for the ship number, equal to the case number to Geometry:

Obviously, it is dimensionless. You may want to examine the ORCA() function. Let's make the ship number the 'leading' parameter in the presentation of results. In its Slots&Properties, change the Output to value to HEADER, see figure 2. As only one parameter can be leading, set the Output to value of Lpp back to OUT.

Figure 2   Setting output to Header makes a parameter 'leading' in the workbase

  Finally, add the relation for the stability overview to your Top Goals:

By adding to a parameter, Quaestor automatically assigns it the TeLiTab dimension. Similarly, a assigns a string dimension (see also QuaestorSyntax). The relation defines that GM, GM_rounded and Ship_no should added as goals in the Ships object for each case (B and Lpp combination). Stability# will contain the data from the original selected object Ships, augmented with the three columns and all data needed to calculate these results. 
Make sure Stability# is determined by system/function

When solving for Stability#, is needs the object Ships. If you select the object Data in the Dataset, the object Ships is available, because it is an object within Data.

  Select Dataset in the Workbase, and start the Process Manager. Just select Data, and run a solution for Stability#. You might want to inspect your solution by opening the TeLiTab (double clicking on the value of Stability# or press F2).

Hereafter, delete this solution.

4    Creating a section between TeLiTabs


We'd like to assign a stability and comfort rating to each of our ships. This rating, based on the rounded value of GM, is available in TeLiTab format:0

Our stability overview also contains values for GM_rounded, so we'd like to combine these two TeLiTabs.

  Add the following relation to your Top Goals

You may want to evaluate the syntax of this function, the description can be found here.

Note that our rating TeLiTab should be included in the dataslot of the relation, as described in tutorial 3. Make sure the syntax is valid, the data slot should contain:

If you run a calculation now with Stability_check# as top goal (and select Data as dataset), you will obtain a solution in which Stability_check# using object Ships, augmented with:  and  

  Run a solution for Stability_check# using Data in the dataset. Inspect the TeliTab.

Note that while you can normally see the TeLitab result in the Workbase when double clicking on the value of Stability_check#, now it does not open in the Workbase but opens as text. The reason is that it containts parameters not yet defined in the knowledge base (Comf and Stab).  When you would add these to the knowledge base (  , New Parameter/Function...) this is changed.

Delete the solution when done.

5    Display only the relevant parameters  


The result of the above calculations contains a large amount of data that will not be necessary in further calculations. To clean up the solution, by removing the parameters we do not want to be displayed, we will use the function UNFOLD#(). This function can be used to change the hierarchy of a TeLiTab and to include or exclude parameters from a TeLiTab. We will adjust the relation that we used to calculate Stability_check$, to exclude parameters.

   Edit the relation for Stability_check# to

The meaning of this function can be found out by inspecting the documentation on UNFOLD#(). This function can be used to change the hierarchy of a TeLiTab and to include or exclude parameters. The mode of the function is 1 here, wich means that only the parameters at the end of the syntax (Ship_no to Comf) are present in the telitab. Now, only the relevant data is displayed in the TeLiTab Stability_check#

6    Selecting the best and the worst ship 


From the TeLiTab Stability_check# we can now select the ship that scores best on both "Stab" as "Comf" (Stability and comfort). To do so, we will use the function MATCHCASE(). 

   Add the following relations to the class Stability:

Which are both dimensionless and System/Equation. 

These functions return the case numbers of the ships that score either highest or lowest on stability and comfort. The function MATCHCASE() returns integer values, so the number of decimal places should be zero for these new parameters.

7    One solution for all results

While working with a knowledgebase, it is convenient to have a small number of solutions that contain data in an organized way, rather than have a lot of solutions that contain separate results of calculations. In this paragraph, we will create one solution that contains the TeLiTab Stability# as well as the best and worst ship numbers.

To add a parameter to a solution that will be calculated after a defined top goal, the attribute @SUBGOALS can be used. It should be placed in the dataslot of the expression editor of one of the relations that is used to calculate the top goal. We will address the sub goals in the relation for Stability_check#.

  In the dataslot of the relation Stability_Check# in the Expression Editor, add the following attribute:

See figure 3

Figure 3   Adding subgoals to a solution by using an attribute

The parameter Stability_check# will now return an overview of all ship with stability and comfort rating. If this parameter is calculated the best and worst ship number will be added to the solution because of the attribute above.

  Run a solution for Stability_check# using the ships data.

The result should be like shown in figure 4.

Note: If Quaestor presents some parameters with an empty cell and waits to continue, these parameters may not be determined by System/Function. If you just press enter without changing something, the parameter will still be calculated though. If you'd like a fully-automatic solution, you'll have to change the determined by value in the slots and properties window of the parameter.



Figure 4   The solution of Stability_check

As mentioned in a previous tutorial, by means of the @ORDER attribute in the data slot of a parameter, you can organise the order in which the end result is presented. 

8    Check 

You can verify your results by comparing it to [Tutorial 4 Finished] 

<< Back to tutorial 3 – Continue to tutorial 5 >>

  • No labels