注册 登录
中国神经科学论坛 返回首页

chenghwn的个人空间 https://bbs.bioguider.com/?68 [收藏] [复制] [分享] [RSS]

日志

C#编程获得的智能软件的文件部分

已有 2183 次阅读2016-11-13 20:23 |个人分类:智能科学

下面是我用C#编程获得的智能软件的文件部分(相当于数据库)。主要是根据我的理念编程的,保证运行时不出现错误,至于是否符合我的预想,现在还没有验证。现在正在修改操作部分,它比文件部分复杂多了,仅是一些语法错误就够我修改的了。

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.IO;

 

namespace WindowsFormsApplication8

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        int getdress; //获得地址

        int outdate;  //获得传出数据

        int putdress; //记入地址

        int indate;  //记入数据

        byte[] abydata = new byte[10]; //

        byte[] bydata = new byte[10]; //

        int byda; //

        int inda; //

        int z = 0;

        public int lingshilabel;

        int recordnumbers = 0;

        int[] opheight = new int[9];

        FileStream fs = new FileStream("d:\\textfil.txt", FileMode.Create);

        void getfun(int getdress, ref int outdate, FileStream fd)  //通过地址获得数据

        {

            fd = fs;

            outdate = 0;

            getdress = (getdress - 1) * 10 + 1;

            int mte = getdress;

            fd.Seek(getdress, SeekOrigin.Begin);

            fd.Read(bydata, 0, 10);

            for (int k = 0; k <= 9; k++)

            {

                byda = bydata[k];

                if (byda == 10) break;

                outdate = outdate + byda * (int)Math.Pow(10, k);

            }

        }

        void putfun(int putdress, int indate, FileStream fd) //通过地址记入数据

        {

            fd = fs;

            int zhongjie = indate;

            putdress = (putdress - 1) * 10 + 1;

            int zh = 1;

            int k = 0;

            for (k = 0; k <= 9; k++)

            {

                if ((int)Math.Pow(10, k - 1) > zhongjie)

                {

                    abydata[k] = 10;

                    zh = abydata[k];

 

                }

                else

                {

                    inda = indate % 10;

                    abydata[k] = (byte)inda;

                }

                indate = (indate - indate % 10) / 10;

                if (zh > 9)

                    break;

            }

            fd.Seek(putdress, SeekOrigin.Begin);

            fd.Write(abydata, 0, k);

        }

        //在各中枢的传出(传入到各中枢)。传出的记忆柱,传到的记忆柱z=2是强度传入int cwidthnn,ref int clengthn

        public void crr(ref int oprecordnumbern, ref int recordnumbern, ref int z, ref int cwidthnn, ref int clengthn)

        {

 

            if (z == 1)

            {

                lingshilabel = recordnumbern + 9588;

                recordnumbers = 0;

                if (lingshilabel < 12)

                {

                    lingshilabel = 2;

                }

                getfun(lingshilabel, ref  recordnumbers, fs);

                if (recordnumbers == 0)

                {

                    recordnumbers = (recordnumbern) + 4800;

                }

                //获得传出recordnumber

                recordnumbers = recordnumbers + 1; //获得在传出需要putrecordnumber的位置recordnumberccr中已经计算+4800

            }

            //z=2是强度传入

            if (z == 2)

            {

                recordnumbers = recordnumbern + 1600 * 4 - 50 + (clengthn - 1) * 2 + cwidthnn; // subzrecordnumber=1600

            }

            int lingshilabel1 = oprecordnumbern + 9589;

            int oprecordnumbers = 0;

            if (lingshilabel1 < 12)

            {

                lingshilabel1 = 2;

            }

            getfun(lingshilabel1, ref  oprecordnumbers, fs);

            if (oprecordnumbers == 0)

            {

                oprecordnumbers = oprecordnumbern;

            }

            oprecordnumbers = oprecordnumbers + 1; //'计算出opreordnumber

            putfun(lingshilabel1, oprecordnumbers, fs); //记录入传人9589

            putfun(lingshilabel, recordnumbers, fs);//记录入传人9588

            putfun(recordnumbers, oprecordnumbers, fs); //记录入传人4800+

        }

 

        //感觉传入。强弱不同的数字进行转换,还包括奖惩预期中枢的强度区的9个记忆柱的传入与标记,jczslaber是第几个基本记忆柱群共有9个。yi是易与不易的记忆柱。记录位置是9575cf=0是奖赏中枢, cf=1是惩罚中枢。jczslaber=cr(只是在需要时这样赋值。),cr决定kongjn.获得传到的对应中枢arecordnumber[n 1](arecordnumber)。传出中枢的recordnumbern

        public void gjcr(ref int kongjn, ref int arecordnumber, ref int recordnumbern, ref int z)

        {

            int[] opheight = new int[9]; int opcheightn = 0; int zhongjie = 0;

            for (int number = 1; number <= 8; number++)

            {

                zhongjie = (opcheightn + zhongjie) * 10;

                opcheightn = Convert.ToInt32(kongjn / (Math.Pow(10, (8 - number)))) - zhongjie; //顺序获得8个表示强弱的数字

                opheight[number] = opcheightn; //得到opheight(1),opheight(1),opheight(1)……等等。

            }

            //获得8个数据传入,传到对应的中枢相应的位置

            for (int clengthn = 1; clengthn <= 8; clengthn++)

            {

                int cwidthnn = opheight[clengthn]; //定位基本记忆柱cwidthnn相当于cwidth[n].cwidthn=2

                for (int yu = 1; yu <= 2; yu++) //易兴奋的与不易兴奋的都参与传出,2是易兴奋的,定位记忆柱

                {

                    //包含易兴奋的与不易兴奋的,是应该传到的。是所在记忆柱的起始前的recordnumber

                    int oprecordnumbern = arecordnumber + (clengthn - 1) * 2 * 9600 * 2 + (cwidthnn - 1) * 9600 * 2 + (yu - 1) * 9600;

                    crr(ref oprecordnumbern, ref recordnumbern, ref z, ref cwidthnn, ref clengthn);

                }

            }

        }

 

 

        //状态中枢内部的传出联系

        public void ztzs(int recordnumbern, int oprecordnumbern)

        {

            //在皮质是易与不易兴奋的记忆柱,所以要除以2,而在状态中枢是三个。;

            int lingshilabel = oprecordnumbern + 9589;

            int oprecordnumber = 0;

            getfun(lingshilabel, ref oprecordnumber, fs);  //'被传入的记忆柱

            if (oprecordnumber == 0)

            {

                oprecordnumber = (oprecordnumbern);

            }

            //被传入的记忆柱

            oprecordnumber = oprecordnumber + 1;

            lingshilabel = recordnumbern + 9588;

            int recordnumber = 0;

            getfun(lingshilabel, ref recordnumber, fs);

            if (recordnumber == 0)

            {

                recordnumber = (recordnumbern) + 4800;

            }

            for (int m = 1; m <= 3; m++)

            {

                recordnumber = recordnumber + 1;

                oprecordnumber = oprecordnumber + 1; //'计算出opreordnumber

                lingshilabel = oprecordnumbern + 9589 + 9600 * (m - 1);

                putfun(lingshilabel, oprecordnumber, fs); //记录入传人9589

                lingshilabel = recordnumbern + 9588;

                putfun(lingshilabel, recordnumber, fs);//记录入传人9588        

                putfun(recordnumber, oprecordnumber, fs); //记录入传人4800+

            }

        }

 

        public void qdzh(ref int oprecordnumbern)

        {

            int cr = 12121212;

            int lingshilabel = (oprecordnumbern) + 9592;

            putfun(lingshilabel, cr, fs); //记录入九种不同的强度

            cr = 11221122;

            lingshilabel = lingshilabel + 1;

            putfun(lingshilabel, cr, fs);

            cr = 11222211;

            lingshilabel = lingshilabel + 1;

            putfun(lingshilabel, cr, fs);

            cr = 11112222;

            lingshilabel = lingshilabel + 1;

            putfun(lingshilabel, cr, fs);

            cr = 22221111;

            lingshilabel = lingshilabel + 1;

            putfun(lingshilabel, cr, fs);

            cr = 22111122;

            lingshilabel = lingshilabel + 1;

            putfun(lingshilabel, cr, fs);

            cr = 22112211;

            lingshilabel = lingshilabel + 1;

            putfun(lingshilabel, cr, fs);

            cr = 21212121;

            lingshilabel = lingshilabel + 1;

            putfun(lingshilabel, cr, fs);

            cr = 11111111;

            lingshilabel = lingshilabel + 1;

            putfun(lingshilabel, cr, fs);

        }

        private void button1_Click(object sender, EventArgs e)

        {

 

             ; int yu  //yu=2是易兴奋的记忆柱,1是不易兴奋的记忆柱

              ; int qdm=0

 

            ; int clengthn //一个中枢在长度空间上的第几个记忆柱

             ; int cheightn

              ; int cwidthn

 

               ; int oplengthn //一个中枢在长度空间上的第几个记忆柱

                ; int opheightn

                 ; int opwidthn

                  ; int recordnumbern //具体到一个记忆柱之前的所有的recordnumber

                   ; int recordnumber //要读写记忆柱的recordnumber所在的位置

                //标志一个中枢的记忆柱的纤维联系方式

                    ; int outputsamen = 5; //一个记忆柱在相同中枢的传出所到达的记忆柱数。

            int outputnotsamen = 4; //一个记忆柱在不同中枢的传出所到达的记忆柱数。

          

 

 

            int acentern = 68;

            int[] clength = new int[69];

            int[] cheight = new int[69];

            int[] cwidth = new int[69];

            int[] clabel = new int[69];

            int[] cq = new int[69]; //定义传入强度中枢的类型感觉中枢的联络区1,可选择成为主注意对象,奖惩中枢的联络区53是强度中枢的联络区,2是运动中枢。

            int[,] ccenter = new int[69, 4];

            int[] center = new int[69];

            int[] yd = new int[69]; //运动中枢记录兴奋强度的九个记忆柱的标志。

            int[] arecordnumbe = new int[69];

            clength[1] = 8; cheight[1] = 2; cwidth[1] = 1; clabel[1] = 1; cq[1] = 1; //轮廓

            clength[2] = 8; cheight[2] = 2; cwidth[2] = 1; clabel[2] = 1; cq[2] = 1; //空间

            clength[3] = 9; cheight[3] = 9; cwidth[3] = 9; clabel[3] = 2; ccenter[3, 1] = 2; ccenter[3, 2] = 1; ccenter[3, 3] = 4; cq[3] = 0; //2(传出)//诱导注意视角对象

            clength[4] = 8; cheight[4] = 2; cwidth[4] = 1; clabel[4] = 1; cq[4] = 1; //组成轮廓的线段所在的空间

            clength[5] = 0; cheight[5] = 0; cwidth[5] = 0; clabel[5] = 0; cq[5] = 0;

            clength[6] = 8; cheight[6] = 2; cwidth[6] = 1; clabel[6] = 1; cq[6] = 1; //声调

            clength[7] = 8; cheight[7] = 2; cwidth[7] = 1; clabel[7] = 1; cq[7] = 1; //频率

            clength[8] = 8; cheight[8] = 2; cwidth[8] = 1; clabel[8] = 1; cq[8] = 1; //空间

            clength[9] = 9; cheight[9] = 9; cwidth[9] = 9; clabel[9] = 2; ccenter[9, 1] = 6; ccenter[9, 2] = 7; ccenter[9, 3] = 8; cq[9] = 0; //678//三个综合

            clength[10] = 50; cheight[10] = 1;cwidth[10] = 1; clabel[10] = 6; cq[10] = 8; //10记录的为感觉传入的强度,对应相应的中枢。兴奋到一定的强度会传入奖赏中枢,有的是专门传入奖赏或者惩罚中枢。

            clength[11] = 8; cheight[11] = 2; cwidth[11] = 1; clabel[11] = 2; ccenter[11, 1] = 13; ccenter[11, 2] = 0; ccenter[11, 3] = 0; cq[11] = 1; //10111213都为感觉传入,痛觉,及其它。

            clength[12] = 8; cheight[12] = 2; cwidth[12] = 1; clabel[12] = 1; cq[12] = 1;////1112是奖赏感觉刺激中枢

            clength[13] = 8; cheight[13] = 8; cwidth[13] = 1; clabel[13] = 1; cq[13] = 1;////1413是惩罚感觉刺激中枢

            clength[14] = 0; cheight[14] = 0; cwidth[14] = 0; clabel[14] = 0; ccenter[14, 1] = 0; cq[14] = 0;

            clength[15] = 4; cheight[15] = 1; cwidth[15] = 1; clabel[15] = 9; ccenter[15, 1] = 13; ccenter[15, 2] = 12; ccenter[15, 3] = 0; cq[15] = 7; //奖惩中枢的核心区1534是运动中枢相联系的。

            clength[16] = 8; cheight[16] = 2; cwidth[16] = 1; clabel[16] = 1; ccenter[16, 1] = 0; ccenter[16, 2] = 0; ccenter[11, 3] = 0; cq[16] = 1; //感觉中枢的联络区

            clength[17] = 8; cheight[17] = 2; cwidth[17] = 1; clabel[17] =1; cq[17] = 5; //奖的强弱的联络区

            clength[18] = 8; cheight[18] = 2; cwidth[18] = 1; clabel[18] = 1; cq[18] = 5; //惩的强弱,的联络区

            clength[19] = 3; cheight[19] = 1; cwidth[19] = 1; clabel[19] = 4; ccenter[19, 1] = 16; ccenter[19, 2] = 17; ccenter[19, 3] = 18; cq[19] = 0; //强度综合

            clength[20] = 8; cheight[20] = 2; cwidth[20] = 1; clabel[20] = 2; cq[20] = 6; //运动中枢的联络区,表示几个基本的运动

            clength[21] = 8; cheight[21] = 2; cwidth[21] = 2; clabel[21] = 2; cq[21] = 6; //运动调节中枢的联络区,表示几个基本的运动的基本调节

            clength[22] = 8; cheight[22] = 2; cwidth[22] = 1; clabel[22] = 1; cq[22] = 1; //这一些感觉传入的联络区

            clength[23] = 8; cheight[23] = 2; cwidth[23] = 1; clabel[23] = 1; cq[23] = 1;

            clength[24] = 8; cheight[24] = 2; cwidth[24] = 1; clabel[24] = 1; cq[24] = 1;

            clength[25] = 9; cheight[25] = 9; cwidth[25] = 9; clabel[25] = 2; ccenter[25, 1] = 22; ccenter[25, 2] = 23; ccenter[25, 3] = 24; cq[25] = 0;  //一些感觉传入

            clength[26] = 8; cheight[26] = 2; cwidth[26] = 1; clabel[26] = 1; cq[1] = 3;  //

            clength[27] = 36; cheight[27] = 1; cwidth[27] = 1; clabel[27] = 8; ccenter[27, 1] = 26; cq[27] = 8; //奖惩中枢的联络区的强度总和

            clength[28] = 8; cheight[28] = 2; cwidth[28] = 1; clabel[28] = 1; cq[28] = 3; //强度中枢的联络区28.29.30.31.32.33.34.35.36.37.38

            clength[29] = 8; cheight[29] = 2; cwidth[29] = 1;clabel[29] = 1; cq[29] = 3;

            clength[31] = 8; cheight[31] = 2; cwidth[31] = 1; clabel[31] = 1; cq[31] = 3;

            clength[30] = 8; cheight[30] = 2; cwidth[30] = 1; clabel[30] = 1; cq[30] = 3;

            clength[32] = 8; cheight[32] = 2; cwidth[32] = 1; clabel[32] = 1; cq[32] = 3;

            clength[33] = 8; cheight[33] = 2; cwidth[33] = 1; clabel[33] = 1; cq[33] = 3;;

            clength[34] = 8; cheight[34] = 2; cwidth[34] = 1; clabel[34] = 1; cq[34] = 3;

            clength[35] = 8; cheight[35] = 2; cwidth[35] = 1; clabel[35] = 1; cq[35] = 3;

            clength[36] = 8; cheight[36] = 2; cwidth[36] = 1; clabel[36] = 1; cq[36] = 3;

            clength[37] = 8; cheight[37] = 2; cwidth[37] = 1; clabel[37] = 1; cq[37] = 3;

            clength[38] = 8; cheight[38] = 2; cwidth[38] = 1; clabel[38] = 1; cq[38] = 3;

            clength[39] = 8; cheight[39] = 2; cwidth[39] = 1; clabel[39] = 1; cq[39] = 3;

            clength[40] = 8; cheight[40] = 2; cwidth[40] = 1; clabel[40] = 1; cq[40] = 3;

            clength[41] = 8; cheight[41] = 2; cwidth[41] = 1; clabel[41] = 1; cq[41] = 3;

            clength[42] = 8; cheight[42] = 2; cwidth[42] = 1; clabel[42] = 1; cq[42] = 3;

            clength[43] = 8; cheight[43] = 2; cwidth[43] = 1; clabel[43] = 1; cq[43] = 3;

            clength[44] = 8; cheight[44] = 2; cwidth[44] = 1; clabel[44] = 1; cq[44] = 3;

            clength[45] = 8; cheight[45] = 2; cwidth[45] = 1; clabel[45] = 1; cq[45] = 3;

            clength[46] = 8; cheight[46] = 2; cwidth[46] = 1; clabel[46] = 1; cq[46] = 3;

            clength[47] = 8; cheight[47] = 2; cwidth[47] = 1; clabel[47] = 1; cq[47] = 3;

            clength[48] = 8; cheight[48] = 2; cwidth[48] = 1; clabel[48] = 1; cq[48] = 3;

            clength[49] = 8; cheight[49] = 2; cwidth[49] = 1; clabel[49] = 1; cq[49] = 3;

            clength[50] = 8; cheight[50] = 2; cwidth[50] = 1; clabel[50] = 1; cq[50] = 3;

 

            clength[67] = 2; cheight[67] = 1; cwidth[67] = 1; clabel[67] = 9; cq[67] = 0; //主注意目的对象的奖惩预期的值的大小。其值的大小兴奋奖惩预期中枢的联系区

            //计算出状态中枢的基本记忆柱群数。5068之间都可以添加联络中枢如运动感觉中枢等

            int n;

            int[] g = new int[69];

            for (n = 1; n <= 67; n++)

            {

                g[1] = 0;

                g[n + 1] = g[n] + clength[n] * cheight[n] * cwidth[n];

            }

            clength[68] = (int)g[68];  cheight[68] = 1; cwidth[68] = 1; clabel[68] = 7; cq[1] = 0; //状态中枢for n = 1 to 25,g[1] = 0,g[n + 1] = g[n] + clength[n] * cheight[n] * cwidth[n],print g[26],next

          

 

            /*19是感觉中枢;

            ‘共有9600recordnumber.cq是对强度的综合。ccenter是专门联系的中枢。;

            9587皮质传递到状态中枢,状态中枢传递到皮质。;

            9578是记忆柱的标志;

            ‘共有9600recordnumber;*/

            //传出加9600,传入不加

            // 04800传入,传出48006400以后

            //6400+19560,传入一段1580

 

            //95609565记录在一个空间的记忆柱

            //9565 记录要读的段,用1或者2表示,记录的段总是进行记忆的段。(1)(2

            //9566 是段的时间与zqtime,qzqtime的关系jyzxftime

            //9567 是记忆柱的突触开始兴奋的时间 (1)兴奋周期突触最早兴奋时间

            //9568 记录有多少传入(1,与读取的展示框的位置一致)+1

            //9569 标志兴奋强(1)+2

            //9570 是记忆柱的突触开始兴奋的时间(2

            //9571记录有多少传入(2

            //9572 标志兴奋强度(2

            //9573 记忆柱兴奋时间 (1) 这一或前一兴奋周期的时间

            //9574 记忆柱兴奋时间(2

            //9575 标记奖惩联络区的强度中枢的9个记忆柱。或者运动传出的9个记忆柱。

            //9576 记录记忆柱的空间标志。中枢标志加长度标志。

            //9577 记录状态中枢的目的对象与主注意对象是否兴奋过。

            //9578 记录展示柜的位置,同时也记入展示框

            //9579 传出到易与不易兴奋的记忆柱,是基本记忆柱群之间的事。

            //9580 是中枢的位置(cq标志1,是主注意对象选择的标志。5是奖惩预期的标志,3是强度中枢,6是运动中枢的联络区)

            //9581 具体中枢标记

            //9582    +2 功能柱的位置

            //9583    +3  2

            //9584   +4

            //9585    +5

            //强度中枢或奖惩来表示强度   9586                     +6

            //传出到状态中枢 9587                 +7

            //写文件时第几个传出 9588    +8

            //第几个传入 9589

            //与奖惩联络区对应的奖惩区 95909591  +10+11一对一的传播

            //19中枢。强度中枢总的兴奋强度存在九个兴奋级别'959295939594'959595969597959895999600

              int[] kongjn = new int[10]; //感觉传入再传出。weizhi代表8种兴奋参数,既可以表示强度也可以表示其它信息。

                            kongjn[1] = 12121212; //每一记忆柱都代表13个参数。

                            kongjn[2] = 11221122;

                            kongjn[3] = 11222211;

                            kongjn[4] = 11112222;

                            kongjn[5] = 22221111;

                            kongjn[6] = 22111122;

                            kongjn[7] = 22112211;

                            kongjn[8] = 21212121;

                            kongjn[9] = 11111111;

            int yi; int opn; int outputsame; int arecordnumbern; int oprecordnumbern;

            int lingshilabel1; int lingshilabel; int oprecordnumber;

            int[] arecordnumber = new int[69]; int cr;

            acentern = 68;

            for (n = 1; n <= acentern; n++) //计算每个中枢及之前的总recordnumber

            {

                arecordnumber[n] = arecordnumber[n - 1] + clength[n] * cheight[n] * cwidth[n] * 9600 * 2;

            }

            for (n = 1; n <= arecordnumber[68]; n++)

            {

                lingshilabel1 = 0;

                putfun(n, lingshilabel1, fs);

            }

 

            for (n = 1; n <= acentern; n++) //定位中枢

            {

                switch (clabel[n]) //联络区的联络

                {

                    case 1:

                        {

                            for (clengthn = 1; clengthn <= clength[n]; clengthn++)

                        {

                            for (cwidthn = 1; cwidthn <= cwidth[n]; cwidthn++) //定位基本记忆柱

                            {

                                for (cheightn = 1; cheightn <= cheight[n]; cheightn++) //计算出所有的基本记忆柱群

                                {

                                    for (yu = 1; yu <= 2; yu++) //易兴奋的与不易兴奋的都参与传出,2是易兴奋的,定位记忆柱

                                    {

                                        recordnumbern = arecordnumber[n - 1] + (clengthn - 1) * cheight[n] * cwidth[n] * 9600 * 2 + (cwidthn - 1) * cheight[n] + (cheightn - 1) * 9600 * 2 + (yu - 1) * 9600; //获得对象记忆柱之前的所有的recordnumber                         

                                        int kjbz; //空间标志

                                        kjbz = 10 * n + clengthn;

                                        lingshilabel = recordnumbern + 9576;

                                        putfun( lingshilabel,   kjbz, fs); //为主注意对象的选择作准备。;

                                        lingshilabel = recordnumbern + 9580;

                                        lingshilabel1 = cq[n];

                                        putfun(  lingshilabel,   lingshilabel1, fs); //为主注意对象的选择作准备,为奖惩,感觉,运动选择做准备。;

                                        for (opn = 1; opn <= acentern; opn++) //各中枢被传入的

                                        {

                                            if (yu == 2 && opn != n) goto gotolabel1; //如果是易兴奋的只能是内部联系

                                            if(clabel[opn]==1|clabel[opn]==3)

                                            {

                                          

                                                       if (opn != n) //中枢不相同,这是外部联系

                                                        {

                                                            //计算出基本length,height

                                                            for (outputsame = 1; outputsame <= outputnotsamen; outputsame++) //与被传入中枢联系的基本记忆柱群的数目

                                                            {

                                                                oplengthn = clengthn + 1 + outputsame; //计算第几个传出

                                                                if (oplengthn > clength[opn]) //计算出length,从第几个基本记忆柱群开始计算

                                                                {

                                                                    oplengthn = oplengthn - clength[opn];

                                                                }

                                                                for (opheightn = 1; opheightn <= cheight[opn]; opheightn++)  //得出,height,联络区一般没有width

                                                                {

                                                                    for (yi = 1; yi <= 2; yi++) //外部联系包含易兴奋的与不易兴奋的

                                                                    {

                                                                        oprecordnumbern = arecordnumber[opn - 1] + ((oplengthn - 1) * cheight[n] + opheightn - 1) * 9600 * 2 + (yi - 1) * 9600;

                                                                        int z=1;

                                                                        int cwidthnn = 0;

                                                                        crr(ref oprecordnumbern, ref recordnumbern, ref z,ref cwidthnn,ref clengthn);

                                                                    } //yi外部联系包含易兴奋的与不易兴奋的

                                                                } //opheight

                                                            } //outputsame

                                                         } //if opn

                                                      

                                                        if (opn == n) //中枢相同,内部联系

                                                        {

                                                            //要明确中枢的位置

                                                            for (outputsame = 1; outputsame <= outputsamen; outputsame++)

                                                            {

                                                                oplengthn = clengthn + 1 + outputsame; //计算第几个传出

                                                                if (oplengthn > clength[opn]) //计算出length

                                                                {

                                                                    oplengthn = oplengthn - clength[opn];

                                                                }

                                                                for ( opheightn = 1; opheightn <= cheight[opn]; opheightn++) //得出,height

                                                                {

                                                                    for (yi = 1; yi <= 2; yi++) //yi2

                                                                    {

                                                                        if (yu == 2 && yi == 1) goto gotolabel12; //易兴奋的记忆柱不需要传出到不易兴奋的记忆

                                                                        //在各中枢的传出(传入到各中枢)

                                                                        oprecordnumbern = arecordnumber[opn - 1] + ((oplengthn - 1) * cheight[n] + opheightn - 1) * 9600 * 2 + (yi - 1) * 9600;

                                                                        int z=1;

                                                                        int cwidthnn = 0;

                                                                        crr(ref oprecordnumbern, ref recordnumbern, ref z,ref cwidthnn,ref clengthn);

                                                                    gotolabel12: ;

                                                                    } //yi2

                                                                } //for opheight = 1 to cheight(opn) '得出,height

                                                              } //outputsame

                                                            } //opn == n                                                     

                                                    }//clabel[opn]==1|clabel[opn]==3)

                                                gotolabel1: ;

                                                    }//opn = 1; opn <= acentern; opn++) //各中枢被传入的

                                            } //yu

                                       

                                    } //cheight(n)

                                } //clength(n)

                            } //cwidth(n)

                       

                        //case 2的中枢没有传入只有对应传出

                break;

                }

           

                    case 2: //'case 2的中枢没有传入只有对应传出

                        {

                         

                            for (int m = 1; m <= 3; m++) //三个ccenter(n,m)

                            {

                                if (ccenter[n, m] == 0) goto gotolabel10;

                                for (clengthn = 1; clengthn <= clength[n]; clengthn++) //n是第几个中枢这里是第三个,顺序读出这个中枢的clength空间

                                {

                                    for (cwidthn = 1; cwidthn <= cwidth[n]; cwidthn++)

                                    {

 

                                        for (cheightn = 1; cheightn <= cheight[n]; cheightn++) //这个中枢的cheight计算

                                        {

                                            arecordnumbern = arecordnumber[n - 1] + (clengthn - 1) * cheight[n] * cwidth[n] * 9600 * 2 + (cwidthn - 1) * cheight[n] + (cheightn - 1) * 9600 * 2;  //第三中枢的各基本记忆柱之前所有的recordnumber,只有不易兴奋的能传出。

                                            //感觉中枢传出只有不易兴奋的记忆柱群

                                            int kjbz; //空间标志

                                            kjbz = 10 * n + clengthn;

                                            lingshilabel = arecordnumbern + 9576;

                                            putfun( lingshilabel,  kjbz, fs); //为主注意对象的选择作准备。;但空间及主注意对象的标志好像没有必要。

                                            lingshilabel = arecordnumbern + 9580;

                                            lingshilabel1 = cq[n];

                                            putfun(  lingshilabel,  lingshilabel1, fs); //为主注意对象的选择作准备,为奖惩,感觉,运动选择做准备。。;

                                           

                                            recordnumber = arecordnumbern + 4800;

                                            //感觉传入

                                            int weizhi=0;

                                            if (m == 1)

                                            {

                                                weizhi = clengthn;

                                            }

                                            if (m == 2)

                                            {

                                                weizhi = cheightn;

                                            }

                                            if (m == 3)

                                            {

                                                weizhi = cwidthn;

                                            }

                                            int kongn = kongjn[weizhi];

                                            int arecordnumb = arecordnumber[ccenter[n, m] - 1];

                                            z=1;

                                            gjcr(ref kongn, ref arecordnumb, ref arecordnumbern,ref z);

                                        } //cheightn=1

                                    } //cwidthn=1

                                } //clengthn=1

                            gotolabel10: ; // if ccenter(n,m)=0 then goto 10; // if ccenter(n,m)=0 then goto 10

                            } // for m=1 to 3 '三个ccenter(n,m)

                            break;

                        }

                      

 

                    case 4: //不需要传到奖惩。传到第10中枢。传到强度中枢是易兴奋的传到易兴奋的,不易兴奋的传到不易兴奋的。

                        {

                            int qm = 0;

                            for (int zjzss = 1; zjzss <= 50; zjzss++)

                            {

                                if (clength[zjzss] > 0)

                                {

                                    for (oplengthn = 1; (int)oplengthn <= (int)(clength[zjzss]); oplengthn = (int)oplengthn + 1) //

                                    {

                                        for (opwidthn = 1; (int)opwidthn <= (int)(cwidth[zjzss]); opwidthn = (int)opwidthn + 1)

                                        {

                                            for (opheightn = 1; (int)opheightn <= (int)(cheight[zjzss]); opheightn = (int)opheightn + 1)

                                            {

                                                for (yu = 1; (int)yu <= 2; yu = (int)yu + 1) //易兴奋的与不易兴奋的都参与传出,2是易兴奋的

                                                {

 

                                                    recordnumbern = arecordnumber[zjzss - 1] + (oplengthn - 1) * cheight[zjzss] * cwidth[zjzss] * 9600 * 2 + (opwidthn - 1) * cheight[zjzss] * 9600 * 2 + (opheightn - 1) * 9600 * 2 + (yu - 1) * 9600;  //获得对象记忆柱之前的所有的recordnumber数‘传到强度中枢的记忆柱

                                                    int kjbz; //空间标志

                                                    kjbz = 10 * n + oplengthn;

                                                    lingshilabel = recordnumbern + 9576;

                                                    putfun(lingshilabel, kjbz, fs); //为主注意对象的选择作准备。;

                                                    lingshilabel = recordnumbern + 9580;

                                                    putfun(lingshilabel, cq[n], fs); //为主注意对象的选择作准备,为奖惩,感觉,运动选择做准备。;

                                                    oprecordnumbern = arecordnumber[9] + (zjzss - 1) * 9600 * 2 + (yu - 1) * 9600; //‘获得强度中枢的recordnumber ‘强度中枢的记忆柱);  

 

                                                    lingshilabel = oprecordnumbern + 9589; //传入强度中枢的计算

                                                    oprecordnumber = 0;                                                 

                                                    getfun(lingshilabel, ref oprecordnumber, fs);

                                                    if (oprecordnumber == 0)

                                                    {

                                                        oprecordnumber = oprecordnumbern;

                                                    }

                                                    oprecordnumber = oprecordnumber + 1;

                                                    putfun(lingshilabel, oprecordnumber, fs);

 

                                                    lingshilabel = recordnumbern + 9586;    //记录的是强度中枢的记忆柱标志

                                                    putfun(lingshilabel, oprecordnumber, fs);

 

                                                    lingshilabel = oprecordnumbern + 9592;

                                                    cr = 0;                                                  

                                                    getfun(lingshilabel, ref  cr, fs);

                                                    if (cr < 1)

                                                    {

                                                        qdzh(ref oprecordnumbern);

                                                    }

                                                    int zjjs = oplengthn + opwidthn + opheightn; //oplengthn=opwidthn=opcheightn=1

                                                    //一个中枢对应强度中枢的一个记忆柱

                                                    if (cq[zjzss] == 1 & zjjs == 3)

                                                    {

                                                        //‘只有感觉联络区才对应相应的强度联络区。是为了事件发生概率的预期;

                                                        if (qm == 50) goto gotoqdllq; //[n]只到50

 

                                                        if (qdm < 1)

                                                        {

                                                            qdm = qdm + 27;

                                                        }

                                                        qdm = qdm + 1; //‘从第28中枢开始;

                                                        qm = qdm - 1;

                                                        int kongj = 1;

                                                        for (kongj = 1; kongj <= 9; kongj++) //九种不同的强度来对应强度联络区

                                                        {

                                                            recordnumber = oprecordnumbern + 9591 + kongj;

                                                            int kongn = 0;                                                          

                                                            getfun(recordnumber, ref kongn, fs);

 

                                                            int recordnumbe = arecordnumber[qm];

                                                            int recordnumbernn = oprecordnumbern;

                                                            z = 2;

                                                            gjcr(ref kongn, ref recordnumbe, ref recordnumbernn, ref z);                                                      

                                                        } //for kongj=1 to 9  '九种不同的强度来对应强度联络区

                                                    gotoqdllq: ;

                                                    }

                                                }

 

                                            } //for yu=1 to 2

                                        } //for oplengthn1 to clength(zjzss())

                                    } //for opwidthn1 to cwidth(ccenter(n,1))

                                }

                            } //for opcheightn1 to cheight(ccenter(n,1)

                       break;

                        } //zjzss

                       

 

                    case 7:

                        {

                            //状态中枢的联系

                            for (int ztclengthn = 1; ztclengthn <= clength[68]; ztclengthn++) //皮质与状态中枢的联系

                            {

                                for (clengthn = 1; clengthn <= clength[n]; clengthn++)

                                {

                                    for (cwidthn = 1; cwidthn <= cwidth[n]; cwidthn++) //定位基本记忆柱

                                    {

                                        for (cheightn = 1; cheightn <= cheight[n]; cheightn++) //计算出所有的基本记忆柱群

                                        {

                                            recordnumbern = arecordnumber[67] + (ztclengthn - 1) * 9600 * 3;

                                            z=1;

                                            for (int t = 1; t <= 3; t++) //相互之间是3倍的兴奋强度状态记忆柱的主与从的联系

                                            {

                                                for (int m = 1; m <= 2; m++)

                                                {

                                                    oprecordnumbern = recordnumbern + 9600;

                                                    crr(ref oprecordnumbern, ref recordnumbern, ref z, ref cwidthn, ref clengthn);

                                                    crr(ref recordnumbern, ref oprecordnumbern, ref z, ref cwidthn, ref clengthn);

                                                }

                                            }

                                            int precordnumber = arecordnumber[n - 1] + (clengthn - 1) * cheight[n] * cwidth[n] * 9600 * 2 + (cwidthn - 1) * cheight[n] * 9600 * 2 + (cheightn - 1) * 9600 * 2 + 9587;

                                            lingshilabel = recordnumbern + 9587;

                                            putfun( lingshilabel,   precordnumber, fs); //状态中枢传出到皮质

                                            lingshilabel = recordnumbern + 9587 + 9600;

                                            putfun(  lingshilabel,   precordnumber, fs); //状态中枢传出到皮质的易兴奋的记忆柱

                                            lingshilabel = recordnumbern + 9587;

                                            putfun(  precordnumber,   lingshilabel, fs); //不易兴奋的传出到状态中枢

                                        }

                                    }

                                }

                            } //for clengthn=1 to clength[n] '皮质与状态中枢的联

 

                            for (opn = 1; opn <= 50; opn++) //状态中枢内部的联系

                            {

                                for (clengthn = 1; clengthn <= clength[opn]; clengthn++)

                                {

                                    for (cwidthn = 1; cwidthn <= cwidth[opn]; cwidthn++)

                                    {

                                        for (cheightn = 1; cheightn <= cheight[opn]; cheightn++) //计算出所有的基本记忆柱群

                                        {

                                            recordnumbern = arecordnumber[n - 1] + arecordnumber[opn - 1] * 3 / 2 + ((clengthn - 1) * cwidth[opn] * cheight[opn] + (cwidthn - 1) * cheight[opn] + cheightn - 1) * 9600 * 3; //获得对象记忆柱之前的所有的recordnumber

 

                                            if (clength[opn] < 7) //这种情况下,clength()一般为2如奖惩中枢的核心区这种情况下,只需要联系中枢的前三个

                                            {

                                                for (int op = 1; op <= 50; op++) // '对象在状态中枢的各个传出到的基本记忆柱群。中枢被传入的

                                                {

                                                    for (int opclengthn = 1; opclengthn <= clength[op]; opclengthn++)

                                                    {

                                                        for (int opcwidthn = 1; opcwidthn <= cwidth[op]; opcwidthn++)

                                                        {

                                                            for (int opcheightn = 1; opcheightn <= cheight[op]; opcheightn++) //计算出所有的基本记忆柱群

                                                            {

                                                                if (opclengthn > 3)

                                                                {

                                                                    goto gotolabel13;

                                                                }

                                                                oprecordnumbern = arecordnumber[n - 1] + (arecordnumber[op - 1]) * 3 / 2 + (((opclengthn) - 1) * cwidth[op] * cheight[op] + ((opcwidthn) - 1) * cheight[op] + opcheightn - 1) * 9600 * 3;

                                                                ztzs(  recordnumbern, oprecordnumbern); //状态中枢内部的传出联系

                                                            gotolabel13: ; //if opclengthn>3 then goto 13; //if opclengthn>3 then goto 13

                                                            } //for opcwidthn=1 to cwidth[op]

                                                        } //for opclengthn=1 to clength[op]

                                                    } //for opcheightn=1 to cheight[op]  '计算出所有的基本记忆柱群

                                                } //for op1 to clength[opn]

                                            } //if clength[opn]<7 then

 

                                            if (clength[opn] > 7)

                                            {

                                                for (int op = 1; op <= 50; op++)

                                                {

                                                    if (clength[op] < 7)

                                                    {

                                                        if (clengthn > 2)

                                                        {

                                                            goto gotolabel23; //只需要前两个来联系

                                                        }

                                                        for (int opclengthn = 1; opclengthn <= clength[op]; opclengthn++)

                                                        {

                                                            for (int opcwidthn = 1; opcwidthn <= cwidth[op]; opcwidthn++)

                                                            {

                                                                for (int opcheightn = 1; opcheightn <= cheight[op]; opcheightn++) //计算出所有的基本记忆柱群

                                                                {

                                                                    oprecordnumbern = arecordnumber[n - 1] + (arecordnumber[op - 1]) * 3 / 2 + (((opclengthn) - 1) * cwidth[op] * cheight[op] + ((opcwidthn) - 1) * cheight[op] + opcheightn - 1) * 9600 * 3;

                                                                    ztzs(  recordnumbern, oprecordnumbern);  //状态中枢内部的传出联系

                                                                } //for opcwidthn=1 to cwidth[op]

                                                            } //for opclengthn=1 to clength[op]

                                                        } //for opcheightn=1 to cheight[op]  '计算出所有的基本记忆柱群

                                                    } //if  clength[op]<7 then

                                                gotolabel23: ;//if clengthn>3 then goto dayu3; //if clengthn>3 then goto dayu3

 

                                                    if (clength[op] > 7)

                                                    {

                                                        for (outputsame = 1; outputsame <= outputnotsamen; outputsame++) //与被传入中枢联系的基本记忆柱群的数目

                                                        {

                                                            int opclengthn = clengthn + 1 + outputsame; //计算第几个传出outputn=outputn+1

                                                            if (opclengthn > clength[op]) //计算出length,从第几个基本记忆柱群开始计算

                                                            {

                                                                opclengthn = opclengthn - clength[op];

                                                            }

                                                            for (opclengthn = 1; opclengthn <= clength[op]; opclengthn++)

                                                            {

                                                                for (int opcwidthn = 1; opcwidthn <= cwidth[op]; opcwidthn++)

                                                                {

                                                                    for (int opcheightn = 1; opcheightn <= cheight[op]; opcheightn++) //计算出所有的基本记忆柱群

                                                                    {

                                                                        oprecordnumbern = arecordnumber[n - 1] + (arecordnumber[op - 1]) * 3 / 2 + (((opclengthn) - 1) * cwidth[op] * cheight[op] + ((opcwidthn) - 1) * cheight[op] + opcheightn - 1) * 9600 * 3; ;

                                                                        ztzs(  recordnumbern, oprecordnumbern); //状态中枢内部的传出联系

                                                                    } //for opcwidthn=1 to cwidth[op]

                                                                } //for opclengthn=1 to clength[op]

                                                            } //for opcheightn=1 to cheight[op]  '计算出所有的基本记忆柱群

                                                        } //if  clength[op]>7 then

 

                                                    } //for op1 to 30

                                                } // if  clength[opn]>7 then

 

                                            } //for cheightn = 1 to cheight[opn] '计算出所有的基本记忆柱群

                                        } //for clengthn = 1 to clength[opn]

                                    } //for cwidthn = 1 to cwidth[opn]

                                } //for opn=1 to 30  '状态中枢内部的联系

 

                               

                            }

                            break;

                        }

                } //select case clabel[n]

            }//for n=centern=1 to acentern定位中枢

                       

 

//易兴奋的与不易兴奋的联系

                        for (n = 1; n <= 50; n++)

                        {

                            for (clengthn = 1; clengthn <= clength[n]; clengthn++)

                            {

                                for (cwidthn = 1; cwidthn <= cwidth[n]; cwidthn++) //定位基本记忆柱

                                {

                                    for (cheightn = 1; cheightn <= cheight[n]; cheightn++) //计算出所有的基本记忆柱群

                                    {

                                        recordnumbern = arecordnumber[n - 1] + ((clengthn - 1) * cwidth[n] * cheight[n] + (cwidthn - 1) * cheight[n] + cheightn - 1) * 9600 * 2;

                                        recordnumber = recordnumbern + 9579;

                                        int recordnumber1 = recordnumber + 9600;

                                        putfun( recordnumber,  recordnumber1, fs);

                                        putfun( recordnumber1,  recordnumber, fs);

                                    }

                                }

                            }

                        }

 

 

                        //奖惩预期传入奖惩预期强度1718,到27

                        for(int cf=1;cf<=2;cf++)

                        {

                          

                            for(int anumber=1;anumber<=9;anumber++)

                            {

                                int opcheightn = 0;

                                int zhongjie = 0;

                                for (int number = 1; number <= 8; number++)

                                {

           

                                    zhongjie = (opcheightn + zhongjie) * 10;

                                    opcheightn =  Convert.ToInt32(kongjn[anumber] / (Math.Pow(10, (8 - number)))) - zhongjie; //顺序获得8个表示强弱的数字

                                    opheight[number] = opcheightn; //得到opheight(1),opheight(1),opheight(1)……等等。

                                }

                                for (clengthn = 1; clengthn <= 8; clengthn ++)

                                    {

                                        int cwidthnn = opheight[clengthn]; //定位基本记忆柱cwidthnn相当于cwidth[n]. cwidthn=2

                                        for (yu = 1; yu <= 2; yu ++) //易兴奋的与不易兴奋的都参与传出,2是易兴奋的,定位记忆柱

                                        {                          

                                            //包含易兴奋的与不易兴奋的,是应该传到的。是所在记忆柱的起始前的recordnumber

                                            oprecordnumbern = arecordnumber[26] + (anumber -1) * 9600 * 2 + (yu -1) * 9600+(cf-1)* 9600 * 2*9;

                                            lingshilabel= oprecordnumbern +9580; //在奖惩预期中枢的强度中枢的记忆柱中记入cq

                                            putfun(  lingshilabel,   cq[n], fs);  //

                                            lingshilabel= oprecordnumbern +9575;

                                            lingshilabel1=cf*100+yu*10+ anumber; //9575记入奖惩cf、易yu、不易及位置信息anumber

                                            putfun(  lingshilabel,   lingshilabel1, fs);

                                            recordnumbern = arecordnumber[16+cf-1] + (clengthn - 1) * 2 * 9600 * 2 + (cwidthnn - 1) * 9600 * 2 + (yu - 1) * 9600;

                                            z = 1;

                                            crr(ref oprecordnumbern, ref recordnumbern, ref z, ref cwidthnn, ref clengthn);               

                                        }  

                                }

                            }

                        }

 

                        //‘设置奖惩传入。刺激传入的时候,根据中枢传到10中枢相应的记忆柱,强度是传入的总和,兴奋到一定强度传入奖惩中枢。前9个是感觉传入,主要中介奖惩。随后1616分别是奖惩感觉,如痛觉,或奖赏的感觉。它们都传入奖赏中枢或惩罚中枢。;

                        for (int qdjc = 1; qdjc <= 68; qdjc++) //中介奖赏

                        {

                            //15,1是奖赏中枢,2是惩罚中枢

                            for (yi = 1; yi <= 2; yi++)

                            {

                                recordnumbern = arecordnumber[9] + (qdjc - 1) * 9600 * 2 + (yi - 1) * 9600;

                                int k;

                                if (yi == 1)

                                {

                                    //‘易兴奋的传到奖赏中枢,不易兴奋的传到惩罚中枢的易兴奋的记忆柱。要求强度中枢的不易兴奋的记忆柱不易被兴奋。兴奋太强则兴奋惩罚中枢。;

                                    k = yi + 3;

                                }

                                else

                                {

                                    k = yi;

                                }

                                int jcrecordnumbern = arecordnumber[14] + (k - 1) * 9600;

                                int z=1;

                                int cwidthnn = 0;

                                clengthn = 0;

                                crr(ref jcrecordnumbern, ref recordnumbern, ref z,ref cwidthnn,ref clengthn);

                            }

 

 

                            if (qdjc == 11 | qdjc == 12)

                            {

                                //‘奖赏感觉刺激中枢;

                                recordnumbern = 0;

                                for (yi = 1; yi <= 2; yi++)

                                recordnumbern = arecordnumber[9] + (qdjc - 1) * 9600 * 2 + 10 * 9600 * 2 + (yi - 1) * 9600;

                                int jcrecordnumbern = arecordnumber[14] + (yi - 1) * 9600;

                                for (int m = 1; m <= 3; m++)

                                {

                                    int z=1;

                                    int cwidthnn = 0;

                                    clengthn = 0;

                                    crr(ref jcrecordnumbern, ref recordnumbern, ref z,ref cwidthnn,ref clengthn);

                                }

                            }

 

 

                            if (qdjc == 14 | qdjc == 13)

                            {

                                //‘惩罚刺激中枢;

                                for (yi = 1; yi <= 2; yi++)

                                {

                                    recordnumbern = arecordnumber[9] + (qdjc - 1) * 9600 * 2 + 10 * 9600 * 2 + (yi - 1) * 9600;

                                    int jcrecordnumbern = arecordnumber[14] + (yi - 1) * 9600;

                                    for (int m = 1; m <= 3; m++)

                                    {

                                        int z=1;

                                        int cwidthnn = 0;

                                        clengthn = 0;

                                        crr(ref jcrecordnumbern, ref recordnumbern, ref z,ref cwidthnn,ref clengthn);

                                    }

                                }

                            }

                        }

                        //‘传入奖惩中枢强弱的联络区。;

                        for (int jc = 1; jc <= 4; jc++)

                        {

                            for (yu = 1; yu <= 2; yu++)

                            {

                 

                                recordnumbern = arecordnumber[14] + (yu - 1) * 9600 + (jc - 1) * 9600 * 2;

                                qdzh(ref recordnumbern);

                                for (int kongj = 1; kongj <= 9; kongj++) //九种不同的强度来对应强度联络区

                                {

                                    recordnumber = recordnumbern + 9591 + kongj;

                                    int kongjiann=0;

                                    getfun( recordnumber, ref kongjiann, fs);

                                    int jcqdm=0;

                                    if (jc == 2)

                                    {

                                        jcqdm = 18;

                                    }

                                    if (jc == 1)

                                    {

                                        jcqdm = 17;

                                    }

                                    if (jc == 3)

                                    {

                                        jcqdm = 20;

                                    }

                                    if (jc == 4)

                                    {

                                        jcqdm = 21;

                                    }

                                    int recordnumbe = arecordnumber[jcqdm - 1];

                                    z=2;

                                    gjcr(ref kongjiann, ref recordnumbe, ref recordnumbern,ref z);

                                } //for kongj=1 to 9  '九种不同的强度来对应强度联络区

                            }

                        }

 

 

                }

    }

 

}

 

 


路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

小黑屋|手机版|Archiver|生物行[生物导航网] ( 沪ICP备05001519号 )

GMT+8, 2024-4-25 10:09 , Processed in 0.085043 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

返回顶部