-
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
- 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?
- sprawdzanie słów kluczowych dot. zła
- Re: W czym sie teraz pisze programy??
- Re: (PDF) Surgical Pathology of Non-neoplastic Gastrointestinal Diseases by Lizhi Zhang
- CfC 28th Ada-Europe Int. Conf. Reliable Software Technologies
- Młodzi programiści i tajna policja
- Ada 2022 Language Reference Manual to be Published by Springer
- Press Release - AEiC 2023, Ada-Europe Reliable Softw. Technol.
- Ada-Europe - AEiC 2023 early registration deadline approaching
- Ada-Europe Int.Conf. Reliable Software Technologies, AEiC 2023
- Ile cykli zajmuje mnożenie liczb 64-bitowych?
- Ideologia Polskiego Programisty wer.3
Najnowsze wątki
- 2024-05-04 Bonusowe pytanie rozliczenie sie z elektrownia - fotowoltaika.
- 2024-05-04 Ujawnienie porady prawnej prokuraturze
- 2024-05-04 Jaką kamerkę samochodową polecacie?
- 2024-05-04 Warszawa => Spedytor międzynarodowy <=
- 2024-05-04 Warszawa => Mid PHP Developer (Laravel) <=
- 2024-05-04 Warszawa => Inżynier DevOps (projekt JP) <=
- 2024-05-04 Gdańsk => Specjalista ds. Sprzedaży <=
- 2024-05-04 Łódź => Business Development Manager - obszar bezpieczeństwa IT <=
- 2024-05-04 Warszawa => Interactive/Experience Designer <=
- 2024-05-04 Berlin => IT Systems Administrator and Customer Support Engineer <=
- 2024-05-04 Warszawa => Mid IT Recruiter <=
- 2024-05-04 Odpowiedzialność PORTALU za reklamy
- 2024-05-04 Lunar Rover był elektrykiem. Ważył 35 kg Zasięg 80 km Na Księżycu w 1971 r.
- 2024-05-04 Marki => ERP Implementer <=
- 2024-05-04 Gdańsk => Head of International Freight Forwarding Department <=