Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tutoril 1
Getting

...

strted

 

...

Lerning gols

  1. Getting

...

  1. fmilir with

...

  1. Questor interfce.
  2. Adding functions

...

  1. nd constrints.
  2. Providing references

...

  1. nd properties for

...

  1. prmeters.

...

  1. Creting multiple

...

  1. cse solution.

Prior knowledge

...

  • Interfce

1    Objective

As mentioned earlier erlier these tutorials are tutorils re focussing on providing the basic bsic skills of knowledge of knowledge engineering. In this first tutorialtutoril, the main min dimensions of a ship will be systematically variedsystemticlly vried. The knowledge used is Archimedes’ Law Lw in combination combintion with design requirements, which are re the following:

The ship should havehve

  • a displacement displcement of at least 2000 t lest 2000 t, but less than thn 3000 t;
  • a draft drft of 6 m.

Our objective is to generate a dataset of systematically varied ships that generte dtset of systemticlly vried ships tht meet the design criteriacriteri.

2    Before we

...

strt

Before starting strting with your knowledge your knowledge engineering, please make plese mke sure you are actually re ctully using the knowledge engineering user level and you have Quaestor configured engineering user level nd you hve Questor configured in the most convenient layoutlyout.

To check/change chnge your user level go to the general tab generl tb of  Tools>Options. You can change cn chnge your User level. If you are re not able ble to change chnge it to Knowledge Engineer (level 3), you do not have KE rights. Please contact hve KE rights. Plese contct your ICT department deprtment or Qnowledge for the proper license.

Furhtermore, for editing all ll kinds of properties it is convenient to use the Frame Viewer. Therefore in the  Appeareance tab Apperence tb of Tools>Options select "Use classic frame clssic frme viewer".

3   

...

Creting prmeters

When Questor is strted, n

...

When Quaestor is started, an empty knowledge base bse is automatically createdutomticlly creted

...

 In the Knowledge browser, minimize the 

...

Questor node,

...

nd expnd the NewQkb node (figure 1).

...

Figure 1    Expanding Expnding the Newqkb node

When the knowledgebase knowledgebse node is expandedexpnded, the classes clsses within the knowledgebase are knowledgebse re visible. Classes are Clsses re used to organise orgnise your parametersprmeters, and nd put them in a practicable prcticble structure. The Top GoalsGols/Undefined class clss is part prt of the knowledge base bse by defaultdefult. Here, the goal parameters gol prmeters of your calculation clcultion (Top GoalsGols) can cn be stored, as s well as s other parameters that prmeters tht don't belong to other classes clsses (Undefined).

We'll create a new class named Main crete new clss nmed Min Dimensions, in which the following ship parameters are prmeters re to be stored.

  •     Lpp: Length between perpendicularsperpendiculrs

  •     B: Moulded breadthbredth

  •     T: Draught Drught from keel to Construction Water Wter Line
    Image Removed
     In the Knowledge browser Image Removed Top GoalsGols/Undefined and Undefined nd select new Class Clss (Ctrl+N). Provide the class clss with the name Main nme Min Dimensions. Note that tht the input box will already contain lredy contin the word "GoalsGols". To make a mke new classclss, delete Goals and Gols nd write your class name clss nme (in this case Main cse Min Dimensions). Sub classes can clsses cn be defined by adding dding the main class min clss with sub classes separated clsses seprted by points: GoalsGols.Sub goal

...

  • gol

Figure 2    Creating a Creting new class clss in the knowledge basebse 

The class clss is now shown in the knowledgebase knowledgebse tree, and nd we can add cn dd the parameters prmeters Lpp, B and nd T.

...

 Select the

...

clss Min Dimensions. 

...

 in the right-

...

hnd side of the knowledge browser,

...

nd select New

...

Prmeter/Function(Ctrl+I), see figure 3. Note

...

tht the

...

lst prmeter in focus will be shown in the input field (most

...

probbly ). Delete this

...

prmeter, type Lpp 

...

nd click

...

the Vlue button.

...

Repet these

...

ctions for the

...

prmeters B

...

nd T.

Image Removed 

Figure 3    By right clicking in the right-hand hnd side of the knowledge browser, parameters can prmeters cn be added dded 

The added parameters all appear dded prmeters ll pper like this:

Image Removed 

The red cross is a sign that tht the parameter prmeter is not yet fully defined for the system.
In Quaestor, a valid parameter hasIn Questor, vlid prmeter hs:

  • A unique namenme;
  • A dimension (or assigned ssigned dimensionless);
  • A way wy to be determined: input from the user or defined by a relationreltion.

The first requirement is already satisfiedlredy stisfied, so let's assign ssign dimensions to the parametersprmeters.

...

 Select the Lpp in the 

...

. In the 

...

,

...

chnge the ? sign to m, the dimension for Lpp (meters). A list of possible dimensions is

...

utomticlly shown when you type.

In the larger area lrger re of the Frame Viewer,  reference can cn be assigned ssigned to the parameterprmeter. A proper reference is importantimportnt, as s users of the knowledgebase may knowledgebse my not be certain certin of the exact meaning exct mening of the parameter. Please also read Documentation of knowledge for more details.

...

prmeter. Plese lso red  for more detils.

 Provide Lpp with the reference Length of the ship (figure 4).

Image Removed 

Figure 4   In the Frame Viewer, a dimension and nd reference can cn be assigned ssigned to the parameterprmeter

NOTE: The dimension of a parameter can also be assigned in the Slots & Properties window. prmeter cn lso be ssigned in the  window. Just scroll down to the Dimension row, and change nd chnge the valuevlue.

 

...

 Assign

...

dimension

...

nd reference to the other

...

prmeters B

...

nd T, just

...

s described

...

bove. Of course, the

...

bredth nd depth of the ship

...

re defined in meters.

Now only the last lst requirement for valid parameters has vlid prmeters hs yet to be fulfilled:

  •  A way wy to be determined: input from the user or defined by a relationreltion.

This qualification can qulifiction cn be provided in the Slots ∓ Properties window.

...

 Select the

...

prmeter LPP. In the Slots ∓ Properties window, scroll down to the Determined by row.

...

Chnge the

...

vlue to VR: User only,

...

s the

...

prmeter LPP is input (

...

insted of defined by

...

reltion), see figure 5.

Image Removed 

Figure 5    Let Quaestor know Let Questor know how a parameter prmeter should be determined     

Notice that tht the status sttus of LPP has changed hs chnged toImage Removed

to show that Quaestor knows tht Questor knows enough about bout this parameter prmeter to use it in a computational computtionl model.

...

 Mke sure

...

tht B

...

nd T

...

re determined by VR (

...

Vlue Requested):User only too.

Note that above tht bove you have hve explicitly added dded Lpp, B and nd T as parameters s prmeters to the knowledge basebse
You are also able re lso ble to implicitly add parameter by creating relations that contain new parameters. Quaestor will automatically add these new parameters dd prmeter by creting reltions tht contin new prmeters. Questor will utomticlly dd these new prmeters to your knowledge base bse (so implicitly). You will see this next.

4   

...

Creting reltions

In order to define the loading capacity loding cpcity of the ship, it’s important importnt to know the kind of water wter (Salt Slt or Fresh) the ship will sail sil in. Therefore, we will add some relations and constraints, and make dd some reltions nd constrints, nd mke sure the user can cn select the watertypewtertype.

We'll add dd two relationsreltions, one for salt water and slt wter nd one for fresh waterwter.

...

  Select Top

...

Gols/Undefined in the knowledge browser, 

...

 in the right

...

hnd side nd select New

...

Reltion (Ctrl+N). In the upper

...

prt of the new window, delete

...

ny proposl (Questor my hve filled in the

...

lst selected

...

prmeter),

...

nd enter

Rho = 1025

(belonging to

...

slt wter),

...

nd press 

...

Sve (figure 6).

...

 Figure 6   Entering a relationreltion 

Note that tht when you enter a relation, Quaestor provides as reltion, Questor provides s much help as s possible by means mens of the Help Checker. This checker shows what wht to expect (in this case a Value or an cse Vlue or n Expression, ValExp).  After saving a relationsving reltion, the Help Checker will check the syntax syntx for possible errors, and shows a warning message nd shows wrning messge when something is wrong.

Because Becuse of entering the relationreltion, the parameter prmeter Rho has automatically hs utomticlly been createdcreted. Furthermore, note and realise that the parameter is created nd relise tht the prmeter is creted in the Class Clss in focus when saving sving the relationreltion. For Rho to be a valid parametervlid prmeter, a dimension should be assignedssigned.

...

  Provide

...

reference for rho

...

nd ssign it the dimension kg/m^3. Rho is now

...

vlid prmeter. Furthermore,

...

mke sure rho is determined by SYS: System/

...

Eqution, s reltion is used to determine rho.

The following might seem a bit unconventionalunconventionl: a second relation reltion is given for Rho. This is a nice example exmple of how quaestor questor works: In a calculationclcultion, Quaestor can  Questor cn find numerous calculation paths and automatically clcultion pths nd utomticlly chooses the most appropiate ppropite one based on constraints and available databsed on constrints nd vilble dt. An infinite number of relations can reltions cn be assigned ssigned to one particular parameterprticulr prmeter.   

...

  Add the following

...

reltion (belonging to fresh

...

wter) in

...

similr wy s described bove

Rho = 998

5   

...

Creting constrints

The two relations reltions for the density of the water are wter re only valid vlid for their corresponding watertypewtertype. Therefore, constraint  constrint is added dded to each relationech reltion. A constraint constrint is simply a restriction for the validity vlidity of the relationreltion.

...

  Double click Top

...

Gols/Undefined in the knowledge browser:

...

ll reltions in tht clss re shown (this will work for

...

ny clss). One

...

cn lwys edit reltion by selecting it

...

nd pressing F2 (or 

...

 nd select edit). This is

...

lso useful method to find out which

...

reltion you

...

ctully selected.

Now 

...

 the

...

reltion Rho =

...

1025 nd select 

...

Constrint->Add New. In the upper

...

prt of the new window enter the following

...

constrint:

...

Wtertype$= "SW"

...

nd press Sve (figure 7).

 Image Removed

Figure 7   Adding a constraint constrint to a relationreltion

The constraint constrint is now added, and a parameter named Watertype$ has been createddded, nd prmeter nmed Wtertype$ hs been creted. The $ at t the end of the parameter name makes sure Quaestor recognizes it as a String value, and prmeter nme mkes sure Questor recognizes it s  String vlue, nd the dimension Str is automatically assigned utomticlly ssigned (see also Quaestor syntaxlso Questor syntx. We have hve to assign a ssign  determined by value  vlue to make it a valid parametermke it vlid prmeter.

Image Removed  Make Mke sure Watertype$ Wtertype$ is determined by VR: User Only, as s the user should provide the information informtion concerning the water wter type.

We repeat repet the process for the other relationreltion

...

  Add the

...

constrint

...

Wtertype$ = "FW" to the

...

reltion Rho=998. Note

...

tht the expression editor

...

ssist you with the

...

presenttion of existing

...

prmeters nd intrinsic function. When you press enter while

...

n existing

...

prmeter or function is blue, this

...

prmeter or function is

...

plced in the expression editor.

Both relations are reltions re now connected to the corresponding watertype wtertype by means mens of the value vlue of the string Watertype$Wtertype$. Note if Rho is needed in the calculation clcultion progress, Quastor Qustor will note that tht the watertype wtertype is needed and nd will ask sk the user for this value vlue (because becuse it is assigned ssigned User Only).

TIP: By selecting a parameter prmeter in the knowledge base and bse nd then double clicking the box below the knowledge base bse tree, the relations defining that particular parameter are reltions defining tht prticulr prmeter re visible (figure 8).
Moreover, when you select a relation reltion in the knowledge basebse, and nd double click that tht box, the parameters that can be calculated prmeters tht cn be clculted by the selected relation are reltion re shown.
When single clicking the box, all ll connections to the parameter prmeter or relation are reltion re shown. See also information lso informtion on the Knowledge Browser.Image Removed

 Figure 8   When selecting a parameter and prmeter nd double clicking the box indicated indicted by the blue arrowrrow, all relations defining that parameter are  ll reltions defining tht prmeter re shown.

6   

...

Creting dropdown menu

Because Becuse there are re only two possible values vlues for Watertype$ Wtertype$ (SW or FW), it's easy esy to integrate a integrte dropdown box. 

 

...

  Select

...

Wtertype$ in the knowledge browser,

...

nd dd the following text

...

s reference text in the

...

frme viewer (figure 9):

...

Wtertype

...

SW<eq>Sltwter 

...

FW<eq>Freshwter

Image Removed 

Figure 9   A dropdown box is created creted by entering this information informtion in the reference slot of the frame frme viewer

The use of a dropdown box will be clear in a later stage cler in lter stge of this tutorialtutoril, when calculations are madeclcultions re mde. Note that you can add the @EQEXPLAIN attribute tht you cn dd the  ttribute to the data dt slot of the Watertype$ parameter (see Frame Viewer for data Wtertype$ prmeter (see  for dt slot)  in order to manipulated that mnipulted tht only "SaltwaterSltwter" and nd "FreshwaterFreshwter" are re shown (so without SW and nd FW).

7   

...

Creting reltion for the

...

displcement

On the basis bsis of the earlier erlier defined parameters and prmeters nd the block coefficient Cb coefficient Cb , the displacement displcement of the ship can cn be calculatedclculted.

 

...

  Add the following

...

reltion to the

...

clss Min Dimensions:

DISP= Cb*Lpp*B*T*Rho/1000

which defines the

...

displcement of the ship in tons

Note that tht two new parameters are createdprmeters re creted: the block coefficient Cb and coefficient Cb nd the displacement DISPdisplcement DISP. In order to keep the knowledgebase meaningfulknowledgebse meningful, it is necessary necessry to provide references, dimensions and nd determined by values vlues for these parametersprmeters.

...

  Provide references, dimensions

...

nd determined by

...

vlues for Cb

...

nd DISP. Cb

...

hs no dimension (-), DISP should be in tons (t). Just

...

press ok if Questor notes tht tons is no

...

bse dimension (kg), it is just to inform you. We covered this by dividing DISP by 1000. The determined by

...

vlues should be VR: User Only for Cb,

...

nd SYS: System/

...

Eqution for DISP,

...

s the block coefficient is input

...

nd the

...

displcement is determined by

...

reltion.

8   

...

Creting solution

Let's perform our first Quaestor calculationfirst Questor clcultion. A solution is always lwys determined by one or more Top GoalsGols. A top goal gol is a parameter prmeter (or object) that tht is your final calculation targetfinl clcultion trget, in this tutorial tutoril it's the displacement displcement of the ship. 

 

...

  Select the

...

clss Min Dimensions in the knowledge browser. Double click the

...

prmeter DISP.

Note that tht the Image Removed sign of DISP changed chnged to Image Removed, indicating that indicting tht it's a top goal gol for the calculationclcultion.

Calculations and solutions are managed Clcultions nd solutions re mnged in the workbaseworkbse. Here, solutions can cn be createdcreted, redone (with different datadt), examined and exmined nd deleted. 

...

  In the

...

workbse, click the 

...

 button when you

...

use clssic buttons or the "

...

Crete Solution" button when you use

...

the  to strt the clcultion with top

...

gol DISP.

The calculation clcultion progress is startedstrted, and Quaestor first nd Questor first collects all ll input data dt (figure 10).

Image Removed 

 Figure 10   Input data dt for the calculationclcultion

Entering data dt is easyesy: just type a value vlue for each ech selected parameter and prmeter nd press enter to switch to the next one.

...

  Enter the following

...

dt for our first

...

clcultion:

        B= 10   Cb= 0.55   Lpp= 60   T= 6  

...

Wtertype$= SW (

...

Slt Wter)

Note that tht the input of Watertype$ Wtertype$ consists of a dropdownbox, which we created creted in (4), see figure 11. 

Image Removed 

 Figure 11   Watertype$ can Wtertype$ cn be selected in a dropdownbox

After providing the data dt you have hve to press the Image Removed button or "Accept input &mp; Continue" button to continue. The actual calculation ctul clcultion is started strted now, and nd the right-hand hnd side of the workbase workbse shows the situation sitution of figure 13. During the calculationclcultion, the box indicated indicted with the blue arrow rrow shows the status sttus of the calculationclcultion.

Because Becuse this is a very simple exampleexmple, the final state is alost immediately finl stte is lost immeditely shown.Image Removed

Figure 13   Status Sttus of the calculation and clcultion nd solution

The top goal gol (DISP) is shown, together with all parameters that ll prmeters tht were used for the calculationclcultion. With these input valuesvlues, the displacement displcement of the ship is about bout 2030 tons.

9    Multiple

...

cse solutions

So farfr, we created creted one solution, which is shown in the workbase workbse (figure 14).Image Removed

 Figure 14   All solutions are re shown in the workbaseworkbse 

As mentioned in the objective, we'd like to create a dataset of systematically varied crete dtset of systemticlly vried ships. We could of course perform several calculations severl clcultions with different input data dt by handhnd, but it's much easier esier to use the ability of Quaestor to create multiple case bility of Questor to crete multiple cse solutions. To keep the complexity of this example exmple within reasonreson, we will only vary vry the breadth and bredth nd length of the vessel. Please Plese note that tht due to some important conceptual reasons the latest Quaestor release can importnt conceptul resons the ltest Questor relese cn only perform calculations clcultions on ranges rnges of parameters prmeters when you alreade have created a lrede hve creted solution.

...

   In the

...

workbse, select the solution you

...

hve lredy creted (clled the sme s the top-

...

gol prmeter DISP).

...

Restrt the solution by pressing the 

...

 or "Redo Solution" button in the

...

workbse.

...

 Questor will present the previous input,

...

chnge the following input:

B= 9(0.5)11 m    Lpp= 55(2)69 m

In this

...

wy, B

...

nd Lpp

...

re defined by

...

rnge, given the

...

strt vlue, step size

...

nd end

...

vlue. For

...

exmple, Lpp is defined from 55 to 69 meter, with steps of 2 meter.

...

Questor will sk if it should

...

crete cse mtrix for Lpp (figure 15), click yes (

...

n explntion will follow).

 Image Removed

Figure 15    Quaestor asks if a case matrix 15    Questor sks if cse mtrix should be createdcreted 

You will see that tht the single value vlue input is still in the list and nd the multi case values are cse vlues re in the table part tble prt of the Workbase. Press the Image Removedbutton or "Accept input &mp; Continue" button to continue.

The new solution is now createdcreted. The fixed values are again vlues re gin shown in the right hand hnd side of the workbaseworkbse. The varying parameters vrying prmeters (B and nd Lpp) and nd the corresponding solution for DISP are re shown in the lower partprt. Each Ech row is a different casecse, identified by a case  cse number(#1, #2, etc.), see figure 16.Image Removed

Figure 16    Multiple case cse solutions are re shown in the workbaseworkbse, each ech row is a different case cse 

What Wht does the Case matrix Cse mtrix question meanmen?  Note that tht the variations vritions of B do not correspond to the variations vritions of Lpp: there are re 5 values vlues for B and nd 8 values vlues for Lpp. If we would have answered No to the Case matrix hve nswered No to the Cse mtrix question, five variations vritions of B would have hve been mademde, each ech one with the corresponding value vlue of Lpp (the last lst 3 Lpp values vlues would be omitted). In that waytht wy, there would be only five casescses. As we answered yes to nswered yes to the question, all ll possible combinations are combintions re considered, which results in 5*8=40 casescses. You can easily cn esily notice the difference by creating a creting new solution with the same sme input valuesvlues, but now answer no to nswer no to the case matrix cse mtrix question.

NOTE: Ranges can Rnges cn be defined in multiple wayswys

  • Individual values can be separated by comma’sIndividul vlues cn be seprted by comm’s: 9, 10, 11 or, when in the Modeller tab tb of Tools>Options you have hve selected "Use ";" instead insted of "," in range rnge input", the separation seprtion is by means mens of a semi colon (;);
  • You can cn define a range rnge with a begin, an n end and nd number of steps (intervalsintervls): 9(&mp;2)11;
  • You can cn define a range rnge with a begin, an n end and a nd step size: 9(1)11;
  • You can cn define a range rnge with a begin, an n end and a nd step size, including the last lst element when this is smaller than smller thn the whole amount mount of steps: 9(#1)11.5;

10   

...

Mnge solutions


Our multiple case cse solution table tble is sorted by the breadth bredth of the ship, as s shown in figure 16. Suppose we'd like parameter Lpp the leading parameter prmeter Lpp the leding prmeter in this tabletble.

 

...

   In the knowledge browser, select the

...

prmeter Lpp. In the Slots &mp; Properties window, scroll down to the row Output to,

...

nd select HEADER (figure 17). Now, refresh the

...

tble of the multiple

...

cse solution by clicking

...

nother solution,

...

nd then

...

gin the multiple

...

cse solution. The

...

tble is now

...

leded by Lpp.

Image Removed

 Figure 17   By selecting Output to HEADER, the parameter prmeter will 'leadled' the multiple case cse solution tabletble

A lot of cases cses in our solution don't meet the design criteriacriteri: a displacement displcement between 2000 and nd 3000 ton. We could have hve fixed this by adding a constraint dding constrint to DISP, but another way nother wy is to use  filter in the solution tabletble.

...

   In the

...

workbse, select the

...

lst (multiple

...

cse) DISP solution,

...

nd click the 

...

  or "Filter" button. The filter window shows. For DISP,

...

select Rnge s filter, fill in 2000 for Lower

...

bound nd 3000 for upper bound (figure 18). Click the Applybutton.

Image Removed 

 Figure 18   With a filter, cases that cses tht do not fulfill the filter conditions can cn be made mde invisible

Now, only the cases cses for which 2000<DISP<3000 are re shown in the tabletble. Our objective has hs been completed:  we build a dataset of systematically varied ships that dtset of systemticlly vried ships tht meet the design criteriacriteri.

11    Check

You can cn verify your results by comparing it to [Tutorial compring it to < style="text-decortion: none;">[Tutoril 1 Finished] 

Continue to tutorial tutoril 2 >>