TODO -- what to do in SIMLIB ============================ - initial Makefile - print message || default - linux ? - SIMLIB.sh install as SIMLIB gather statistics: minstep,maxstep,... clean-up old version, prepare SIMLIB 2.19 [2006?] RunNumber variable, run-time cerr output of ETA RENAME files (escape the MSDOS 8.3 legacy, leading 8 characters should be different for each file) Try autoconf? ---- Constant C = value; --- problem with disabled copy-ctr new directory layout ./doc|src|examples, global Makefile MERGE delay.h zdelay.h optimize.h into simlib.h new BUGLIST.txt file check for problems with GCC 3.3.2 (debian) -- models crash if compiled without -O2 solved by GCC 3.4 ? -- NOT -- it can be libc problem also NEW DESIGN: namespace SIMLIB, use templates, etc add Expression(Expression) [like Integrator] ? add logging levels - 0=none 1=basic ... 9=all? or subsets - bit0=memory bit1=process bit2=queues ... ======= new MAKEfile all Your `all' production should make every executable of your project. Usually the `all' production doesn't have an explicit rule; instead it refers to all of your project's top-level targets (and, not accidentally, documents what those are). Conventionally this should be the first production in your makefile, so it will the one executed when the developer types `make' with no argument. clean Remove all files (such as binary executables and object files) that are normally created when you `make all'. Don't remove any derived files that came with the distribution, however. dist Make a source archive (usually with the tar(1) program) that can be shipped as a unit and used to rebuild the program on another machine. This target should do the equivalent of depending on `all' so that a `make dist' automatically rebuilds the whole project before making the distribution archive -- this is a good way to avoid last-minute embarrassments! distclean Throw away everything but what you would include if you were bundling up the source with `make dist'. This may be the the same as `make clean' but should be included as a production of its own anyway, to document what's going on. When it's different, it usually differs by throwing away local configuration files that aren't part of the normal `make all' build sequence (such as those generated by autoconf(1); we'll talk about autoconf(1) in Chapter 10 on portability). realclean Throw away everything you can rebuild using the makefile. This may be the same as `make distclean', but should be included as a production of its own anyway, to document what's going on. When it's different, it usually differs by throwing away files that are derived but (for whatever reason) shipped with the project sources anyway. install Install the project's executables and documentation in system directories so they will be accessible to general users (this typically requires root privileges). Initialize or update any databases or libraries that the executables require in order to function. uninstall Remove files installed in system directories by `make install' (this typically requires root privileges). The presence of an uninstall feature implies a kind of humility that experienced Unix hands look for as a sign of thoughtful design. ======= (done) discrete-only subset of SIMLIB (partialy done) integrate optimization algorithms & infrastructure (done) integrate fuzzy extension Doxygen comments in source restructuralization of modules ----------------------------------------------------------------------------- Condition c(in,UP,function1,DOWN,function2) Condition c(in,UP,function) Condition c(in,DOWN,function) Condition c(in,function) Bool = c.Value() in==Bool ==> halv-interval in==Real ==> regula falsi? possible inheritance and redefinition of Action() by any code + DEMO - accuracy in x/y = f(minstep,dy/dt) ----------------------------------------------------------------------------- Makefile universal, calls Makefile.`uname` ?????????? or special parameters? no_shared, c++name, ... clean the semantic for Facility/Store/etc add STL containers, remove non-STL upport ----------------------------------------------------------------------------- test with other compilers (BC++,VC++) Borland C++ 5.0x -- changes, testing, exceptions? DOC: nespolehat na okamzik ruseni procesu atd.. ADD: NO_WAITUNTIL, NO_PROCESS, DISCRETE_ONLY, CONTINUOUS_ONLY clean-up code, remove 'magic' comments ###!!!??? ----- ADD statistics for simulation run: model time: start-stop-length [model-time-units] ??? real time: start[date:time]-stop-length [seconds] continuous step length: len-min len-max len-avg # of conti. steps #of shortened (calls to ContractStep) #of widened (+1%max) # of event activations (Run) # of WaitUntil activations (WAU) # of discontinuity times (all StateCondition changes activation) # of output events = Sampler calls ----- ADD model statistics: at end of Run # of process and events (created,now?) # of contiblocks (Integrators, Delay, ...) created # of Queues, Facilities, Stores, ... created CHANGE Process implementation: use void* CZECH only section: ---------------------------------------------------------------------------- TODO - delay: ============= kratka zpozdeni --- problem s moznou smyckou !!! !! obcas testovat if MaxStep < delay_time moznost zadat maximum zpozdeni --> rezervace mista pro prodluzovani zpozdeni!!! zajistit vzorky pri skokove zmene v modelu (time-event, state-event) TJ pred a po zmene! (Time-event funguje, Conditions OK 12.8.98) je hotovo ??? ---------------------------------------------------------------------------- neni testovano, co uz je - upravit adresare/soubory dokumentace - zakladni (README,TODO,BUGLIST,...) do SIMLIB/ 980612: - upravit Makefile pro DOS-BC>=5, DJGPP>=2.8 - vyhodit _test_ globalni Makefile pro Make-simlib, Make-examples, Make-test, ... - upravit pro STL! - dodelat dokumentaci v anglictine (popis+tutorial) - README - bloky zpozdeni (vzorkovane i obecne) ---------------------------------------------------------------------------- kontrola zbytecnosti! = novy I/O system + kontrola pri propojovani! aContoBlock magic number vse jen v jednom adresari ?? move to Linux! -- Histogram-doplnit funkce pro rel.cetnost, kumulativni.cetnost, sum pridat do atributu, doresit okrajove hodnoty, (automaticke upravy?) +priklad procesor.cpp upravit!!! -- VSE prelozit do anglictiny!!! (pouze dokumentaci a nektere priklady take cesky) trida PeriodicEvent, + parametr AutoStart/kdy? !!!! ------------------------------------------------------------------------- JAK zpracovat rozdil blok/funkce? Limit l;... l(x,lo,hi) NEBO/A (a + Limit(x,lo,hi)) co s tim? NELZE pojmenovat stejne! Envelope: Limit Letter: SIMLIB_Limit objekt staticky (deklarace)/ tmp (vyraz) ve vyrazu jen zprostredkuje propojeni !!! FUNGUJE - je treba zkoumat dusledky! ------------------------------------------------------------------------- doplnit bloky podle 4.4.96 ------ Polynom3 - ax3 + bx2 + cx (+ d??) Horner rizeny integrator soustavy!1! !!!diskretni bloky dt,... port+outstream+sampler pro vzorkovani vystupu !!!!!! WaitUntilList: KONTROLA: - prochazi cyklicky dokud nejsou _vsechny_ FALSE (problem: zacykleni!!!???) změna struktury List <-> ListItem <-> SimObjectLink? základ 3 ukazatele ukazatele Link a Where (nejen fronta) cíl: možnost doplnit informace do ListItem u některých front? 22.3.96 ------- KONTROLA: inicializovat _vsechny_ atributy trid v CTR !!!! NEW: experiment jako funkce/objekt? SimulationExperiment() REGISTRACE: vsechny instance aBlock pri vzniku => mozne testy a GC !!! (seznam - slozitost: in=const, out=N) zjistit proc je Sin s velkym S ???? (asi byly problemy, ale mozna jen ve starych prekladacich !!!!) vice abstrakci EventActive,EventPasive a alias Event special Condition: a) s tolerancí, b)s detekcí bez překročení meze class History: zaznamenat stav objektu metoda Activate u bloku - provede akci pri stavove podmince??????? POZOR: SetInput se neprojevi v pripade zadratovani struktury --> pouzit novou tridu InputRef:aContiBlock??? class X { Input i; public: X() : i(Sin(i)) {} // chyba - neinicializovany odkaz }; Input povolit jan na predavani parametru a vraceni odkazu (jen alokace na STACK?) prevod na STL a STD-LIB !!!!!!!!!!!!!!!!!! NumericalIntegration: - funkce static v modulu method.cpp a friend v Integrator? (ochrana) OUTPUT - rozdelit! !!! instalovatelne akce: - stepchange dovoli efektivne sledovat zmeny delky kroku - Start/Stop doplnky - everyStep implementace = kontejnery ^funkci ------ Relay r; r.PreEvent|PostEvent(Event*) ____.|.^^^^ (obvykle pro tisk) ^^^^^ a SimpleRelay1 jen jednosmerne || rele bez testu abstrakce GATE fronta | ---> ovladano bool, jako WaitUntil Event: automaticky ukončovat!!! nelze! novy priklad: animace delky fronty atd..... publikovat ZDROJOVE TEXTY STL priority Queue! SetName,GetName,RemoveName - pojmenovani objektu - zmenit: Facility F; SetName(F,"zarizeni1"); ?????????????????? Randomize,Random - ukazatele? SetRandom????? nebo objekty RandomValue x[(type?,base_function)] (2 varianty? jednoducha/rychla a lepsi/pomala) - něco převzít z GNU C lib Store S(jmeno,kapacita[,init_kap]); Input operator op ( Input a, Input b ); ^^^^^ ^^^^^^^^^^^^^^^^ nahradit Block & ? - vyhody/ne? NELZE! double--->block problem !@!!!!! Input -- neodkazovat se skrz ale na Input sám a v jeho destruktoru provést přepnutí vstupu ????????????????????? doplnit: blok prepinac x>0:Ainp:Binp ++ ++++ BOOL_BLOCKS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! dovolí Conditions!!! prověřit! : Status - implementace s detekcí smyček??? NE !!!!!!!!!!!!!!!!!!! +++ doplnit double RealTimeOfSimulationRun() [seconds] +++ funkce GetStepSize(), GetAccuracyEstimate(), GetStepNumber() +++ další statistické informace (počty procesů, paměť?, ...) nové RANDOM, PRINT(operátory,fce - ne metody) jména: HashTable OBJid=adresa objektu (this) OPRAVA!!!! doplnit do Input kontrolu pri pouziti (byl-li inicializovan), nebo zavest Expression pro pomocne vyrazy (optimalizaci) 26.4.95: regulace: možnost zastavit integraci u Integrator (vyřadit ze seznamu???) blok omezení - výstup: Omezuje|Neomezuje -- pro spínání integrace^ bloky PI[D] 29.3.95: FUN.CPP: reimplementovat! bloky fun1 fun2, v konstruktoru parametry a funkce (a u debug-verze i textova identifikace "Sin"|"Cos"...) moznost uzivatelske definice (zverejnit bazovy blok) +++nove bloky: Tan, ArcTan, Abs, Sqrt, Sgn, Step, Ramp, Pulse(s), Deriv, Delay, Hold?=Status ==== zvazit implementaci front a kalendare ==== SKIPLISTs !!! c:\ar\sources viz !!!!!!!.cpp Universe - [Sub]Model - Entity ============================== --------------------------------------------------------------------------- ! doplnit pro všechny objekty (entity) zařazení do seznamu objektů modelu (dvojsměrný seznam) Object container Model (nebo Universe?) queue (hierarchická struktura podle 'umístění' v modelu) --------------------------------------------------------------------------- !POPIS: #include "simlib.h" MODEL(jmeno); // makro - generuje jméno, Universe?|Model, kontroly // popis tříd [ // popis experimentu ] nebo #define MODEL "toto je model testujici num. integraci" #include "simlib.h" <<< zde se testuje atd... funkce Init, End třída Experiment e1(Model,Init,End); /// v main() ??? --------------------------------------------------------------------------- ? Process { PID } --------> ThreadTable[PID] { state } ------> stav zasobniku Iterators!!!!!!!!!!!! a) nezavisle moduly: threads, calltable, callptr, container function table for Init(), Run(), etc. -Add-Rem-Call- priority atd... funkce se instalují dynamicky pri pouziti modulu (jinak se nelinkuji) Linux version| MSDOS version BC | GNU C++ diferenční rovnice -> řada zpoždění cyklická fronta -> rychlost oddělit modul THREADS - samostatný a implementačně závislý (a testy pro reimplementaci an jinem HW) oddelit thread a proces - z SIMLIB.H zrusit #include templates!!!!!!!!!!! moduly Random a Stat - oddělit i/o, NumIntMethods - oddělit doplnit #pragma -b -p -u -f -k -ml -d -rd zrušit -Vo a generovat ruzne verze SIMLIB pro ruzne prekladace!!! na konci simlib.h obnovit!!!!!!!!!!!!!!!!!!!!!!!!!!!!! doplnit Monitor(ON|OFF) zkontrolovat integrační metodu - přizpůsobování kroku !!!!!!!! const char *Name() pro Integrator# ... ????? (další vrstva v plánovacím systému? krok spojité sim. 0,1/4,1/2,3/4,1) ====================================================================== integrátory s různými metodami!!!!!!!!!!!! inicializace objektů při Init -- automaticky???? doplnit NameTable dynamicky měnit počet jmen !!!!!!!!!!!! --------------------------------------------------------- Init() -- doplnit inicializace !!!!!!!!!!!!! -------------------------------------------- kontrola sémantiky Store::Leave !!!!!!!!!!!! (parametr) oprava: skripta [156] - ~Zakaznik() !!!!!! nesmí mít parametry nás. dědičnost: opravit new a delete ??? (GNU protestuje) ZMĚNIT! DOPLNIT signály pro přerušení simulace !!!!!!!!!!! (místo ESC bude Ctrl-C) kontrola konzistence operace pri startu/ukonceni simulace (AtStart AtEnd) o do v3.0 TEMPLATE modely pro první přiblížení !!!!!!!!!!!!!!!!!!!!??? o -- 2 verze: SIMLIB a DSIMLIB(debug) (a verze pro ruzne prekladace a systemy) o -- zvážit zákaz typu double v obj. výrazech !!!!!!!!!!!!!!!!!!!!!!!! - podmínky: Condition x( a>b | a, event | funkce) o promyslet výrazy!!!!!!!!!!!!!!!!! o Calendar - reimplementovat!!! o Queue, List, Link, Entity - reimplementovat o Facility, Store - upravit o Garbage collecting!!! na výrazy +- ------------------------------------ o formáty tisku statistik do souboru????? o zajistit automatickou inicializaci objektů při Init() o prostředky pro ladění: - _Memory monitor - _Debug class: proměnné se stavem: čas, počty (procesy,události,...) délka kalendáře, waituntil, ... o rozdělit hierarchii objektů????????????? o generátory náhodných čísel (new) o prozkoumat použití seznamu Integrator a Status (spojit do jednoho?) ---------------------------------------------------------------------------- /////////////////////////// OLD - z HISTORY //////////////////////////////// ---------------------------------------------------------------------------- - doplnit: - integracni metody, (EULER,stiff) - detekce nespojitosti - vypis "nedodrzena presnost" pouze jednou na zac (a na konci jiny) - doplnit on-line graficky vystup DEMO - doplnit novy format vystupniho souboru NEWS! - waituntil x - class XXX : Process, Continuous, Condition { ... } - striktni oddeleni modelu a experimentu ======================================================= - integrace & aproximace - semi-persistent containers - discrete event simulation - numerical analysis - optimization & O.R. - adaptive modelling -queuing systems - exceptions - statistics STRUCT: model ------> rizeni sim. <--> sber dat ----> DISK/... experiment ------> OUTPUTS output-list = seznam objektu pro vystupy vystupy: 1) explicitni - fce Output(co[,kam]) 2) implisitni - AssignOutput(stream#,co) AssignStream(stream#,file[,delta_T]) +- podle typu TXT/BIN OutputBlocks normalblock---->ob----->file NAMES - external identifiers NameTable - hash table of name & pointer to object if object is deleted - search & delete in table AssignName("xxx",obj1) name -> object object -> name fast! objectFlag = named // -> rychlejsi pri delete! NameOf() methods - class names OBJEKT -getStatus -Activate -Identification -Initialize -Ctr/Dtr -Assign operator = !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! operace - formalni specifikace !!!!!!!!!!!!!!!! Pozor!!! doplnit WaitUntilVar waituntil(x); DOPLNIT: - class Delay - obecnou nelinearitu, obecny gen nah. cisel - podminky: Condition C(Event*), C1(void(*)(void)), C2(); Conditions () // typedef symbol !!!! { C(xxxx); C1(x>3); C2(y<2); } Dynamic { .... } class ev1:event { Behavior { .... } // ??????????????????? - OUTPUT !!!!!!!!!!! Použití násobné dědičnosti ???? // ANO !!!!! class DynLink { void Init(procptr x); void Call(); // void Done(); }; class Initializer { // pro inicializaci modulu Initializer ~Initializer }; class Experiment { ... }; usage: MyExperiment e1(T0,T1,...); // it is all! ----------------------------------------------------------------------------