Showing posts with label modeling. Show all posts
Showing posts with label modeling. Show all posts

Monday, September 8, 2008

Modeling Languages

Modeling languages, like any language, have Syntax & Semantics . The Syntax defines the structure any instance model in it can take. each language will have an abstract syntax, and a number of concrete syntax it could be represented with.

Syntax:

concrete syntax can be visual or textual, depending on how we would like to describe the language. A modeling language can have both a textual and a visual syntax. ( think of to a very well defined toString method ) .
Visual Languages syntax can be divided into two streams:
  1. Connection based or Topological: where position and size of different language elements doesn't matter ( irrelevant ). the more specific next level in this branch is Graph based visual languages ( state charts ) , and the next is Plex languages ( DEVS or CBD) where the Arch attachment area have significance ( via ports for example )
  2. Geometric: where position of elements in the model instances does matter. a subset of this brach would the box based languages ( where no overlap is allowed ) (Snieder graphs). the next subset is iconic languages where overlap IS allowed, and the most specifc in this branch are string ( textual ) languages like programming languages for example.
Another thing should be mentioned is that all concrete syntax of a language are translated into the abstract tree syntax. which the essence of a model instance, and will be used in mapping to the semantics domain.
Note: the process of transforming a concrete syntax into the abstract is called Parsing. and the inverse is called pretty printing.

Semantics:
Each language has semantics which is defined by the semantics domain . for example if we take a sentence "2+3" for example, will map into "5" in the semantics domain.
The mapping function M[[ ]], can be in two forms ( they are both identical ):
  1. Denotational : like a translator describes "What"
  2. Operational: describes a procedure of "How" to compute . like a program.
The mapping function has to be unique ( meaning for each abstract syntax it will produce a mapping, and total, meaning that it can give a mapping for any valid input. note also that non-determinism here is ok.

Tuesday, April 15, 2008

Procedural modeling of city generation:

As the game industry is advancing, and the video cards are becoming more powerful, the need for more powerful expressive graphics obviously increase. using modeling techniques to generate such graphics is desirable as it reduces the costs.desire for more details in the graphics .using generation techniques, each graphic can be generated by calling a function with some parameters. these parameters could determine the shape of the tree , or its color . or even some patter it has. and by such making it different form other generated trees. here is few approaches :
  • L-system: used to model plants,it uses rewriting of the graphics by modeling bacteria division populations.
  • Perline noise : uses parametric control and allows for minimal storage management.
  • Tiling : using random distribution function, for placing tiles or objects to create textures .
  • Veroneri Texture basis : place dots randomly , draw lines to produce cellular textures .
  • the main goal is to look realistic rather than behave realistic .
so after looking at this , the question is this ? can we extend this to model generation of complete cities ?

Heterogeneous Modeling and Simulation in Ptolemy:

Ptolemy is a modeling tool that is built entirely on Java. one it's main features is allowing heterogeneous modeling. what this means is that it allows to model different system components using different formalisms. this is especially important as it allows for more power in modeling. like for example in embedded systems where each model represent one aspect of the system( some continuous and some are discrete). it certainly limits the modeler if it was only one formalisms she is doing .
Ptolemy's approach is a hierarchically heterogeneous modeling approach, which means that at each level we use the same modeling formalism.

Monday, April 14, 2008

Modeling of Aspect Weaving

Everyone who has worked with Aspect oriented programs, that are complex enough, would understand the nightmare that they can cause! it's very easy to lose track of what aspect get applied when and in which order ! so a natural approach to deal with such programs is to use modeling techniques. normally any behavior can be modeled in programs as a sequence diagram. so in OO, we model a certain behavior using such a diagram , but in case of Aspect weaving , it would become more complicated . as the behaviour might change if there is a point cut at any location through out the execution. so it would be ideal to describe such aspects , by class diagrams for their structure . and by point cuts and advices for thier behavior. then we can use a "model transformation" to take this building block and apply it on a graph. to produce the sequence diagram that represent the actual execution with the aspect weaved in .

Wednesday, April 9, 2008

XMULATOR

is a network archeticture simulator, normally netwroks can be indirect or direct (butterfly Vs hypercube ). and could have different switching methods: store & forward, wormhole( where messages are divided into flits that get sent) and there is many potenial bottelnecks. in routing algorithms there is a huge deadlocking concern. that's why simulation of these network archeticture becomes important as for analysis purposes ! Xmulator ( XML + simulator) provides a simulation envirnoment for networks. it's implemented using new and modern(object-oriented) programming languages.(implemented in C#) . it defines topologies using XML. and uses red black trees as data structures. where the first layer is generation of random numbers and data structures. it has many features, like listeners based integration which increases the extensibilty ( listeners are defines the events) . the project will attempt at writing a MT ( model transformation) from atom3 models into an XML file which is the input of the simulator.

Tuesday, March 18, 2008

Hybrid (Differential Equations - Statecharts) modelling in Anylogic

Anylogic is a modelling tool which allows modeling systems that are hybrid ( continuous and discrete timed systems) . used mostly for agent based modelling environment. in agent based modeling, individual centric approach is what used, i.e we model the cars rather the system, which will allow us to model instances of the model differently .
In Discrete event modelling, we use statechart with a timer (to generate events) and maybe some plain variables . where as in continuose systems modelling we describe the model using a set of DE that can be solved given any point of time to get a perfect simulation .
this type of systems are especially important in agent based modeling which allows for more realistic simulation . while keeping the individuality of different agents .
check out this great simulation tool at : http://www.xjtek.com/

Monday, March 17, 2008

Statecharts modelling of TankWars

due to growing market share of the game industry throughout recent years, More complex AI in games is in high demand. on of the main requirements is then high reusability, which happens to be one of MDE preaches. so EA sports launched a compeition to write the AI function of tanks in a tank war game. each tank had an AI function that was to be called with environments parameters. it was a time sliced approach which needs simulators so statecharts, was used to model behavior and a class diagram for structure to model the tank game. the tanks needed to avoid obstacles, detect enemy and remember some map information. the AI of the tank models the pilot. so a whole bunch of statecharts that describe the tactical strategy . the simulator cals the AI function , and passes the environment variables. appropriate level of abstraction is introduced , an evet based formalism is the most useful/applicable , statechart ( modularity , event based , simulation and code generation ) .

solving Dynamic Non-causal Algebraic Equation Sets using modeling

Solving algebraic equations using modeling techniques could ease up the process greatly, it can help for effecient and optimal time . in essence a system of equations could be considered a model. and then this model can refactored using simplification rules( like for example make all the terms in the left hand side, and reduce the number of operators by factoring out common terms) .

this really looks like we are refactoring the equations, or the model, its eventually the same equation. but this refactoring is systematic and will lead to reveal the shortest way to solve this model .