-
X-Received: by 10.31.201.198 with SMTP id z189mr2246368vkf.0.1511450456128; Thu, 23
Nov 2017 07:20:56 -0800 (PST)
X-Received: by 10.31.201.198 with SMTP id z189mr2246368vkf.0.1511450456128; Thu, 23
Nov 2017 07:20:56 -0800 (PST)
Path: news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit
0.net!peer02.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-medi
a.com!news.highwinds-media.com!g35no707259qtk.1!news-out.google.com!v55ni1233qt
c.0!nntp.google.com!m31no706902qtf.0!postnews.google.com!glegroupsg2000goo.goog
legroups.com!not-for-mail
Newsgroups: pl.comp.programming
Date: Thu, 23 Nov 2017 07:20:55 -0800 (PST)
Complaints-To: g...@g...com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=5.172.255.94;
posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.94
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7...@g...com>
Subject: procedural -> modular -> agent based
From: fir <p...@g...com>
Injection-Date: Thu, 23 Nov 2017 15:20:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Body-CRC: 3970093528
X-Received-Bytes: 5507
Xref: news-archive.icm.edu.pl pl.comp.programming:211705
[ ukryj nagłówki ]I once wrote on this, but maybe i will
repeat
Im like 'fighting' for 15 years with OOP crap by saying sporadically that it is
stupid and bad, I also often say that procedural is solid and cool (hovever probably
there could be invented something other here too) modular is cool (l love windows
dll-s greatly) and agent based is expected to me to be very cool too
agent bbased paradigm is somewhat researched by some but it is not
presented to much clear and practical afaik, I also on my side research it
a bit (though i dont spend many tme on it i was writing some texts on it)
I once find and wrote here on this group that agent based paradigm can be in fact
realized (made) by normal c coding by using dll-s (his was not quite clear before)
I also was describing how it can be done and show basic elements of that
realisation
i also wrote a basic runing example (though im not sure if i posted it then, now i
slightlt revrite it and may post it to download and see or test - sorry it is much
ugly and basic
but as emmet brown says ;c i got no
time to much improve it (yet))
the basic elements are
1) you code host.exe
this is environment that link to your agents (whose are dll's - each dll is not agent
per sef but it is code for a
group of agents of such type; ho0st will call this agent.dll as many times as he
wants instantiating N agents of given type )
2) you code agent.dll (or more for separate types)
agent.dll has one entry point (i think it may be called Update() though i call i
Run() in my code) this function/method is called in cyclic giving life to given agent
- this is
one and only routine that is called on that agent
agent cyclically pools his environment
(methods for that are provoided by host.exe (it showed fortunatelly that exe can
export functions too, though to be able to link it from agent dlls i need to build
import library for the exe in mingw/gcc)
in my example the api provided are only two functions
__declspec(dllimport) int Move(int dx, int dy);
__declspec(dllimport) int LookAt(int dx, int dy);
one moves agents to adjacent cell on map the second gives info what is on adjacent
tile
yhe host has a controll on that methods, for example if one agent
would like to jump more that to +-1,+-1 position form his current
position host can cut it off - this is very important as it provides hard
interface for agents 'abilities',
environment/hosts limits them and that
makes it really fully work at an agent
paradigm rules (it fully provides them, and thats why its so nice imo)
i wrote ugly and simple host (dorry i got no time but i will wrote more good lokking
and cool in future i hope)
tthat is 2d soccer field
http://minddetonator.htw.pl/uglyhost.png
throwed a lot of 'balls' here (ball symbols more)
and i also coded two agents blacks and whites (each one in 10 instances) and
code them very simple behaviour, blacks walk in random,
int RunAgentBlack()
{
int dx = rand()%3 - 1;
int dy = rand()%3 - 1;
Move(dx, dy);
return 0;
}
whites look right for a bol if there is ball here they move on that ball pushing it,
if no ball at right they are also walk in random
int RunAgentWhite()
{
int dx = rand()%3 - 1;
int dy = rand()%3 - 1;
if(LookAt(1, 0)=='b')
Move(1, 0);
else
Move(dx, dy);
return 0;
}
the app is ugly etc but my purpose was to ilustrate that agent paradigm can be done
in c with dlls , can be well done in c with dll and how can be done in c with dlls
this is this app (can be tested on win32, probably will work in wine)
minddetonator.htw.pl/ag.zip
there is compile bat script there
so if someone only have mingw installed it can edit click and compile its own agent
behaviours
(that could be used to play in some
agents/bot coding, compare the results
and make some agents science and experience, though i sadly know how lazy people are
and do not expect to much from them)
(this post is btw an introduction to tis topic i hope to write more on this after)
Najnowsze wątki z tej grupy
- "Wuj dobra rada" z KDAB rozważa: Choosing the Right Programming Language for Your Embedded Linux Device
- Nowa ustawa o ochronie praw autorskich - opis problemu i szkic ustawy
- Alg. kompresji LZW
- Popr. 14. Nauka i Praca Programisty C++ w III Rzeczy (pospolitej)
- Arch. Prog. Nieuprzywilejowanych w pełnej wer. na nowej s. WWW energokod.pl
- 7. Raport Totaliztyczny: Sprawa Qt Group wer. 424
- TCL - problem z escape ostatniego \ w nawiasach {}
- Nauka i Praca Programisty C++ w III Rzeczy (pospolitej)
- testy-wyd-sort - Podsumowanie
- Tworzenie Programów Nieuprzywilejowanych Opartych Na Wtyczkach
- Do czego nadaje się QDockWidget z bibl. Qt?
- Bibl. Qt jest sztucznie ograniczona - jest nieprzydatna do celów komercyjnych
- Co sciaga kretynow
- AEiC 2024 - Ada-Europe conference - Deadlines Approaching
- Jakie są dobre zasady programowania programów opartych na wtyczkach?
Najnowsze wątki
- 2025-03-29 Warszawa => Specjalista rekrutacji IT <=
- 2025-03-28 A gdyby to był elektryk?
- 2025-03-28 Współczesny falomierz
- 2025-03-28 Rzeszów => WEBCON Developer <=
- 2025-03-28 Szczecin => Specjalista ds. public relations <=
- 2025-03-28 Warszawa => Staż w dziale Sprzedaży B2B <=
- 2025-03-28 Warszawa => MENA New Business Manager <=
- 2025-03-28 Środa Wielkopolska => SAP FI/CO Internal Consultant <=
- 2025-03-28 Białystok => Generative AI Engineer <=
- 2025-03-28 China-Kraków => Key Account Manager IT <=
- 2025-03-28 Warszawa => SQL Developer <=
- 2025-03-28 Gliwice => Ekspert IT (obszar systemów sieciowych) <=
- 2025-03-28 Gliwice => IT Expert (Network Systems area) <=
- 2025-03-28 Warszawa => International Freight Forwarder <=
- 2025-03-28 Ostrów Wielkopolski => Konsultant Wdrożeniowy Comarch XL/Optima (Ksi