A Core Course on Modeling

  • Upload
    tivona

  • View
    58

  • Download
    0

Embed Size (px)

DESCRIPTION

A Core Course on Modeling. Week 2 – the Art of Omitting. Organizing concepts trees tables Organizing meaning objects semantics Notation Mapping ACCEL aggregation: vectors quantified expressions user defined functions. A Core Course on Modeling. Week 2 – the Art of Omitting. - PowerPoint PPT Presentation

Citation preview

  • *A Core Course on ModelingOrganizing conceptstreestablesOrganizing meaningobjectssemanticsNotationMappingACCELaggregation: vectorsquantified expressionsuser defined functions

    Week 2 the Art of Omitting

  • *A Core Course on Modelingconcepts: treesWhere do you live?Week 2 the Art of Omitting

  • *A Core Course on ModelingOrganizing concepts: treescountry (e.g., Netherlands)province (e.g., North Brabant)city (e.g., Eindhoven)quarter (e.g., Woensel)Week 2 the Art of Omitting

  • *A Core Course on ModelingWeek 2 the Art of OmittingOrganizing concepts: treespartOf()country (e.g., Netherlands)province (e.g., North Brabant)city (e.g., Eindhoven)quarter (e.g., Woensel)

  • *A Core Course on ModelingOrganizing concepts: treeskingdom (e.g., animalia)phylum (e.g., chordata) class (e.g., mammalia)order (e.g., cetacea)isA()family (e.g., delphinidae), genus (e.g., orcinus), species (e.g., orca)Week 2 the Art of Omitting

  • *A Core Course on ModelingOrganizing concepts: treesisA()Extensional definition:enumerate existing thingsgrouping in (sub)setsWeek 2 the Art of Omitting

  • *A Core Course on ModelingOrganizing concepts: treesHierarchy: often too restrictiveSubsets often relate to meaningSeveral hierarchies co-existWeek 2 the Art of Omitting

  • *A Core Course on ModelingOrganizing concepts: tablesABCXYZWeek 2 the Art of OmittingAlternative: table

  • *A Core Course on ModelingOrganizing concepts: tablesABCXYZproperty Pvalues A,B,Cproperty Qvalues x,y,zWeek 2 the Art of OmittingAlternative: table

    ABCXc1c2c3Yc4,c5c6Zc7c8c9

  • *A Core Course on ModelingOrganizing concepts: tablesABCXYZproperty Pvalues A,B,Cproperty Qvalues x,y,zWeek 2 the Art of OmittingExample: set of vehicles; P = medium, A,B,C= land, water, air, Q = payload, X,Y,Z = passengers, freight, mail.

    ABCXc1c2c3Yc4,c5c6Zc7c8c9

  • *A Core Course on ModelingOrganizing concepts: tablesABCXYZWeek 2 the Art of Omittingproperty Pvalues A,B,C (group)property Qvalues x,y,z (period)

    ABCXc1c2c3Yc4,c5c6Zc7c8c9

  • *A Core Course on ModelingOrganizing concepts: tablesABCXYZproperty Pvalues A,B,Cproperty Qvalues x,y,zwhat to do with >2 properties?Week 2 the Art of Omitting

    ABCXc1c2c3Yc4,c5c6Zc7c8c9

  • *A Core Course on ModelingOrganizing concepts: tablesABCXYZc4, c5 are undistinguishable[P:B, Q:Y] does not occurWeek 2 the Art of Omitting

    PQc1AXc2BXc3CXc4AYc5AYc6CYc7AZc8CZc9CZ

  • *A Core Course on ModelingOrganizing concepts: tablesABCXYZPQc1AXc2BXc3CXc4AYc5AYc6CYc7AZc8CZc9CZorthogonal table: every property applies to each conceptWeek 2 the Art of OmittingMMMNMNNNM Q

  • *A Core Course on ModelingOrganizing concepts: tablesWeek 2 the Art of OmittingNot every tree leads to an orthogonal table(Orthogonal) table: better compression than treeOrthogonal table: with N properties, distinguish O(2N) concepts or log(M) properties for M concepts.(Arbitrary) tree: N internal nodes for N leaves.

  • *A Core Course on ModelingOrganizing concepts: tablesWeek 2 the Art of Omittingimage: http://www.emiliosanfilippo.it/?page_id=1172orthogonal table ontology: helps explore option space

    tasteholdercreamtoppingcherryice1vanillaconeyessmartiesredice2vanillastickyessmartiesredice3chocsticknohazelnutnoneice4vanillaconenosmartiesgreenice5strawberrybowlyeshazelnutnone

  • *A Core Course on ModelingOrganizing concepts: tablesWeek 2 the Art of Omittingimage: http://www.emiliosanfilippo.it/?page_id=1172orthogonal table ontology: helps explore option space

    tasteholdercreamtoppingcherryice1vanillaconeyessmartiesredice2vanillastickyessmartiesredice3chocsticknohazelnutnoneice4vanillaconenosmartiesgreenice5strawberrybowlyeshazelnutnone

  • *A Core Course on ModelingOrganizing meaning: objectsWeek 2 the Art of Omittingimage: http://www.emiliosanfilippo.it/?page_id=1172ice1 = [taste:vanilla, holder:cone, cream:yes, topping:smarties, cherry:red]coneIce = [taste:{vanilla, choc, strawberry}, holder:cone, cream:{yes, no}, topping:{smarties, hazelnut}, cherry:{red, green, none}]ice = [taste:{vanilla, choc, strawberry}, holder:{cone, stick, bowl}, cream:{yes, no}, topping:{smarties, hazelnut}]

    tasteholdercreamtoppingcherryice1vanillaconeyessmartiesredice2vanillastickyessmartiesredice3chocsticknohazelnutnoneice4vanillaconenosmartiesgreenice5strawberrybowlyeshazelnutnone

  • *A Core Course on ModelingOrganizing meaning: objectsWeek 2 the Art of Omittingimage: http://www.emiliosanfilippo.it/?page_id=1172image: http://gagfunny.com/gag/index.php/tag/living-shadows-illusion/Intensional definition:specifiy things by propertiesirrespective existenceextensional intensional

  • *A Core Course on ModelingOrganizing meaning: objectsWeek 2 the Art of Omittingimage: http://www.emiliosanfilippo.it/?page_id=1172x : Y means:if x and Y are sets: x Yif x is an element: x Yabbreviate {a} by aisA(x,Y) means:for every P in Y, x.P : Y.P.isA(x,Y): inheritance; x inherits from Yx is more concrete, Y is more abstract

  • *A Core Course on ModelingOrganizing meaning: objectsWeek 2 the Art of Omittingimage: http://www.emiliosanfilippo.it/?page_id=1172examples isA( ):ice1: coneIce; conIce : ice;isA(ice1, coneIce);isA(coneIce, ice);isA(ice, [holder:{cone, stick, bowl}])isA(ice, [ ])isA(coneIce, [ ])

    ice1 = [taste:vanilla, holder:cone, cream:yes, topping:smarties, cherry:red]coneIce = [taste:{vanilla, choc, strawberry}, holder:cone, cream:{yes, no}, topping:{smarties, hazelnut}, cherry:{red, green, none}]ice = [taste:{vanilla, choc, strawberry}, holder:{cone, stick, bowl}, cream:{yes, no}, topping:{smarties, hazelnut}]

    a concept with just a single property (holder)a very abstract concept, having no properties at all(a thing)

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concept can be an item (a concrete, unique thing)Organizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concept can be an item (a concrete, unique thing)ora concept can be a classOrganizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concept can be an item (a concrete, unique thing)an item can have propertiesa concept can be a class with values that may be concepts with properties of their ownOrganizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concepts can be an item (a concrete, unique thing)an item can have propertiesa concept can be a class with values that may be concepts with properties of their owna class can be an aggregationora class can be an abstractionOrganizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concepts can be an item (a concrete, unique thing)an item can have propertiesa concept can be a class with values that may be concepts with properties of their owna class can be an aggregation of all similar things, called elements or members (sometimes numbered)a class can be an abstractionOrganizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concepts can be an item (a concrete, unique thing)an item can have propertiesa concept can be a class with values that may be concepts with properties of their owna class can be an aggregation or all different things (elements, members - sometimes named)a class can be an abstractionOrganizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concepts can be an item (a concrete, unique thing)an item can have propertiesa concept can be a class with values that may be concepts with properties of their owna class can be an aggregation or all different things (sometimes named)a class can be an abstractionOrganizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concepts can be an item (a concrete, unique thing)an item can have propertiesa concept can be a class with values that may be concepts with properties of their owna class can be an aggregation or all different things (sometimes named)a class can be an abstraction that typicaly has less properties than its concreter instancesOrganizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concepts can be an item (a concrete, unique thing)an item can have propertiesa concept can be a class with values that may be concepts with properties of their owna class can be an aggregation or all different things (sometimes named)a class can be an abstraction that can be instantiated by a more concrete conceptOrganizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingThe anatomy of concepts:

    a concepts can be an item (a concrete, unique thing)an item can have propertiesa concept can be a class with values that may be concepts with properties of their owna class can be an aggregation or all different things (sometimes named)a class can be an abstraction that can be instantiated by a more concrete concept

    use the right terms for the right things:conceptitemclassaggregation, elementabstraction, instanceproperty

    Organizing meaning: objects

  • *A Core Course on ModelingWeek 2- conceptual modelingNotation: denote aggregationimage: http://www.robertpeake.com/archives/419-manuscript-anxiety.htmlv = {1, 2, 3}, a set with three numerical elements not separately accessiblep = [1, 2, 3], an array with three numbered numerical elements, p[0] = 1q = [a, b, c], an array with 3 numbered concepts, q[0] = ar = [a, b, c], an array with three numbered strings, r[0] = as = [x:1, y:2, z:3], an array with three named numerical elements, s[x] = 1{1, 2, 3} == {3, 2, 1}[1, 2, 3] != [3, 2, 1] whereas [x:1, y:2, z:3 ] == [y:2, z:3, x:1]

  • *A Core Course on ModelingWeek 2- conceptual modelingNotation: denote aggregationimage: http://www.robertpeake.com/archives/419-manuscript-anxiety.htmlv = {1, 2, 3}, a set with three numerical elements not separately accessiblep = [1, 2, 3], an array with three numbered numerical elements, p[0] = 1q = [a, b, c], an array with 3 numbered concepts, q[0] = ar = [a, b, c], an array with three numbered strings, r[0] = as = [ x :1, y :2, z :3], an array with three named numerical elements, s[x] = 1{1, 2, 3} == {3, 2, 1}[1, 2, 3] != [3, 2, 1] whereas [x:1, y:2, z:3 ] == [y:2, z:3, x:1]Quotes are optional for the names of properties

  • *A Core Course on ModelingWeek 2- conceptual modelingNotation: denote aggregationimage: http://www.robertpeake.com/archives/419-manuscript-anxiety.htmlp = [1, 2, 3], an array with three numbered numerical elements, p[0] = 1is an abbreviation for p = ['0': 1, '1': 2, '2': 3]which is the same asp = ['1': 2, '0': 1, '2': 3] (order doesn't matter)But in the abbreviation, naming ('0':, '1':, '2':) is left out. To know which of [1, 2, 3] or [2, 1, 3] is meant, order convention is required.

  • *A Core Course on ModelingWeek 2- conceptual modelingNotation: denote aggregationimage: http://www.robertpeake.com/archives/419-manuscript-anxiety.htmlSets, lists, concepts and accessing elements:P=[a, b, c]: ordered list, [a, b, c] [b, a, c]access elements: P[0] == a, etc.P={a, b, c}: set (unordered), {a, b, c} == {b, a, c}P={a b}: set containing all x, a x b

    P=['john':a, 'pete':b, 'suzy': c]: named list or conceptaccess elements: P['pete'] == b, alternative: P.pete == b['john':a, 'pete':b, 'suzy': c] == ['pete':b, 'john':a, 'suzy': c]there is no notation to access an individual elementonly use for numbers, weekdays, but only for values that have total ordering.

  • *A Core Course on ModelingMappingimage: http://www.corporatienl.nl/hoe-slaat-u-twee-vliegen-in-een-klap/p = [1, 2, 3]q = [10, 20, 30]vector addition:sum = [p[0]+q[0], p[1]+q[1], p[2]+q[2]] = [11, 22, 33]Easier:sum = p + q

    ACCEL applies mapping whenever possible.Week 2 the Art of Omitting

  • *A Core Course on ModelingACCELWhy ACCEL?compare to MS Excel, not to BASIC, C++, Matlab, low threshold for non-programmersfollows to-do-list approach from Lecturesbuilt-in features (chapters 5 & 6)Pareto Genetic OptimizationSensitivity Analysis with Condition Numbers.. why NOT ACCEL?Week 2 the Art of Omitting

  • *A Core Course on ModelingACCEL: aggregationall agregation by vectorsvectors aggregate arbitrary quantitiese.g.: v = [1, 2, 3]; v[1] : 2e.g.: v = [x:1, y:2, z:3]; v[y] : 2 (v.y : 2)also: v = [x:1, y:2, z:3] but NOT v[y] instead of v[y]e.g.: v = [1, [10, 20], 3]; v[0] : 1 v[1] : [10,20] v[1][1] : 20 v[0][1] :undefined but ACCEL tries not to disappoint its usersWeek 2 the Art of Omitting

  • *A Core Course on ModelingACCEL: aggregation but ACCEL tries not to disappoint its usersindex1=slider(0,0,10) index2=slider(0,0,10) printB=b printC=c printD=d a=[1,[10,20],3] b=a[index1]c=b[index2]d=a[index1][index2]Week 2 the Art of Omitting

  • *A Core Course on ModelingACCEL: aggregationnetherlands=[ ,'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03]fr=['cap':'leeuwarden','pop':647239,'area':5748.74]dr=['cap':'assen','pop': 489912, 'area':2680.37]ov=['cap':'zwolle','pop':1138571, 'area':3420.86]gl=['cap':'arnhem','pop':2013903 , 'area':5136.51]ut=['cap':'utrecht','pop':1243161 , 'area':1449.12]nh=['cap':'haarlem','pop':2719764 , 'area':4091.76]zh=['cap':'den haag','pop':3560205 , 'area':3418.50]zl=['cap':'middelburg','pop':381202 , 'area':2933.89]nb=['cap':'den bosch','pop':2470184 , 'area':5081.76]li=['cap':'maastricht','pop':1121483 , 'area':2209.22]

    Week 2 the Art of Omitting

  • *A Core Course on ModelingACCEL: aggregationnetherlands=[, 'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03].prov0=p[0]prov1= prov2= pop0=prov0.poppop1= pop2= totPop=pop0 + pop1 +

    what is the exact population? sum over provincesimage: http://www.dontpaniconline.com/magazine/radar/a-boring-conferenceWeek 2 the Art of Omitting

  • *A Core Course on ModelingACCEL: quantified expressionsnetherlands=[, 'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03].Alternative: quantified expressions

    totPop = #(dummy, seq, term, operation) dummy: a quantity that assumes subsequent values from seq seq: a set of values. E.g., vSequence(0,11) = [0,1,2,3,4,5,6,7,8,9,10] term: an expression,perhaps depending on dummy operation: what to do with the values of termWeek 2 the Art of Omitting

  • *A Core Course on ModelingACCEL: quantified expressionsnetherlands=[, 'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03].Alternative: quantified expressions

    totPop = #(dummy, seq, term, operation)totPop = #(i , [1,2,3] , i , add) totPop = 6 t = [3,4,5,6,7]totPop = #(i , [1,2,3], t [i], add) totPop = t [1] + t [2] + t [3] = 4 + 5 + 6 = 15 u = [[1,2],[3,4],[5,6]]totPop = #(i , [0,1,2], u[i][1], add) totPop = ([1,2])[1] + ([3,4])[1] + ([5,6])[1] = 2 + 4 + 6 = 12Week 2 the Art of Omitting

  • *A Core Course on Modelingnetherlands=[, 'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03].Alternative: quantified expressions

    totPop = #(dummy, seq, term, operation)totPop = #(i, vSequence(0,11), p [i] . pop, add)maxPop = #(i, vSequence(0,11), p [i] . pop, max)minArea = #(i, vSequence(0,11), p [i] .area, min) but suppose we need the most spacious province?ACCEL: quantified expressionsWeek 2 the Art of Omitting

  • *A Core Course on Modelingnetherlands=[, 'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03].Alternative: quantified expressions

    totPop = #(dummy, seq, term, operation)totPop = #(i, vSeq(0,11), p [i] . pop, add)maxPop = #(i, vSeq(0,11), p [i] . pop, max)minArea = #(i, vSeq(0,11), p [i] .area, min) but suppose we need the most spacious province?ACCEL: quantified expressionsWeek 2 the Art of Omitting

  • *A Core Course on Modelingnetherlands=[, 'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03].ACCEL: quantified expressionshttp://www.panoramio.com/photo/12605032spaciousness = area / populationWeek 2 the Art of Omitting

  • *A Core Course on Modelingnetherlands=[, 'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03].maxSpaciousness = #(i, vSeq(0,11), spaciousness(i), max)

    but spaciousness is not a single quantity: depends on i, so takes different values during computation.

    Quantities that depend on other quantities:user defined functions.

    spaciousness(i) = p[i] . area / p[i] . pop

    Notice: i takes various values during the compuation; is not a quantity.Instead i is called a dummy.

    ACCEL: user defined functionsWeek 2 the Art of Omitting

  • *A Core Course on Modelingnetherlands=[, 'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03].ACCEL: user defined functionsmaxSpaciousness=#(i,vSeq(0,11),spaciousness(i),max)spaciousness(i)=p[i].area/p[i].popp=[Pgr,Pfr,Pdr,Pov,Pgl,Put,Pnh,Pzh,Pzl,Pnb,Pli]Pgr=['cap':'groningen','pop':582161,'area':2960.03]. . .Pli=['cap':'maastricht','pop':1121483,'area':2209.22]

    so the most spacious province offers 8900 m2/person ! But which province is that? Week 2 the Art of Omitting

  • *A Core Course on Modelingnetherlands=[, 'provinces':p, ]p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li]gr=['cap':'groningen', 'pop':582161,'area':2960.03].As follows:

    maxSpaciousness=#(i,vSeq(0,11),spaciousness(i),max)spaciousness(i)=p[i] . area / p[i] . popmostSpacious=#(i,vSeq(0,11),if(spaciousness(i)==maxSpaciousness,i,0),max)capitalOfMostSpacious=p[mostSpacious] . cap

    curious for result? Try yourself!

    ACCEL: user defined functionsWeek 2 the Art of Omitting

  • *A Core Course on Modelingidea: expression that is evaluated more than once in a computation: user-defined functionscan be used whenever quantities are usedcan have arbitrary arguments (one or more) with arbitrary names (no name clashes)can return whatever you want, e.g. myFunc(a,b) = ['x':a,'y':b] p=myFunc(3,4) gives result p=['x':3,'y':4] p=myFunc(3,4)['x'] and myFunc(3,4).x both give result p=3use to organize your thinkinguse to keep script readibleuse to shorten scriptuse to keep formal and conceptual models similarACCEL: user defined functionsWeek 2 the Art of Omitting

    * * * * *interesting case:-an empty internal nodeforbidden case:-skipping a layernodes are abstract classes, no real animalsreal animals can be allocated as well, isA(myDog,dog) and isA(penguin,bird)

    * existing things only. So what would be an empty province or, in general, an empty intermediate node?

    Talk about root, nodes and leaves.*Problem with libraries, Alta Vista and V&D: there is not a single best way to group things hierarchically (for all orthogonal propoerties, this doesnt matter).* * * * * * * * * * * * * * **********For programmers:

    for an aggregation of similar things, programmers use an array with numbers as indices

    for an aggregation of different things, programmers use an array with keys (words) as indices i.e., an object which is basically the same as an item with properties********a more concrete concept has properties that are more numerous and / or have narrower defined values

    ************woordgrapje: mapping = meppen (=2 vliegen in een klap)* * * * * * * * * * *Of course, I wcould write maxSpaciousness=#(i,vSequence(0,11),@(@(p,i),'area')/@(@(p,i),'pop'),max)

    but that doesn't read so well.* * *