C++ Neural Networks and Fuzzy Logic: Preface


•  An input vector is generated at random in the function main ( )



Download 1,14 Mb.
Pdf ko'rish
bet350/443
Sana29.12.2021
Hajmi1,14 Mb.
#77367
1   ...   346   347   348   349   350   351   352   353   ...   443
Bog'liq
C neural networks and fuzzy logic

  An input vector is generated at random in the function main ( ), and is later referred to as ip



asgninpt ( ) function presents the input vector ip to the network and determines the initial

activations of the neurons.





getacts ( ) function updates the activations of the neurons after each iteration.

C++ Neural Networks and Fuzzy Logic:Preface

Performance of the Hopfield Network

344





getouts ( ) function computes the outputs after each iteration. la is used as abbreviation for

lambda in its argument.





iterate ( ) function carries out the number of iterations desired.

  findtour ( ) function determines the tour orders of cities to be visited using the outputs of the

neurons. When used at the end of the iterations, it gives the solution obtained for the traveling

salesperson problem.

  calcdist ( ) function calculates the distance of the tour in the solution.

Listing 15.1 Header file for the C++ program for the Hopfield network for the traveling salesperson problem

//trvslsmn.h  V. Rao,  H. Rao

#include

#include

#include

#include

#define MXSIZ 11

class tsneuron

        {

        protected:

        int cit,ord;

        float output;

        float activation;

        friend class network;

        public:

        tsneuron() { };

        void getnrn(int,int);

        };

class network

        {

        public:

        int  citnbr;

        float pra,prb,prc,prd,totout,distnce;

        tsneuron (tnrn)[MXSIZ][MXSIZ];

        int dist[MXSIZ][MXSIZ];

        int tourcity[MXSIZ];

        int tourorder[MXSIZ];

        float outs[MXSIZ][MXSIZ];

        float acts[MXSIZ][MXSIZ];

        float mtrx[MXSIZ][MXSIZ];

        float citouts[MXSIZ];

        float ordouts[MXSIZ];

        network() { };

        void getnwk(int,float,float,float,float);

        void getdist(int);

        void findtour();

        void asgninpt(float *);

        void calcdist();

        void iterate(int,int,float,float,float);

        void getacts(int,float,float);

        void getouts(float);

//print functions

        void prdist();

C++ Neural Networks and Fuzzy Logic:Preface

Performance of the Hopfield Network

345



        void prmtrx(int);

        void prtour();

        void practs();

        void prouts();

        };

Previous Table of Contents Next

Copyright ©

 IDG Books Worldwide, Inc.

C++ Neural Networks and Fuzzy Logic:Preface

Performance of the Hopfield Network

346




Download 1,14 Mb.

Do'stlaringiz bilan baham:
1   ...   346   347   348   349   350   351   352   353   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish