⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 利用C语言实现的人工智能系统
💻 C
📖 第 1 页 / 共 2 页
字号:
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "a9dc2d7b5c024585a11636de04431775", "3f905435f4824d539327c1c5cc9acc40");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "-70");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "72999ab0a09145719a6de10b68c67313", "692cafddc34e4d22b886e28ae00b880a");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "10.0");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "226b8d30341f46bab8d36de6c939f16b", "696fc081f35d401fbf0052619aca133a");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "1.00");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "4924c4377f23425fba8a88a328f6497f", "dc01a06a5b03485bb71ade588c380a0a");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.05");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "39ae2d31712a4c6ead50a89a5aa4bb02", "3f905435f4824d539327c1c5cc9acc40");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "10.6");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "1fab5b8826a64302a0531c1d5a4869a9", "3f905435f4824d539327c1c5cc9acc40");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "334df63bdfea4199b9aaf68c34fe118e", "b9622b84193e415895b7975bbd1e59e8");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "57026a08960c4e958d363a43b2e9085e", "3d770ed0324843929a6b24611cd1656a");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "4b1dec6029c94078bb37376fb7f5cd79", "3f905435f4824d539327c1c5cc9acc40");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "24f98f5d116f49d495b5cc34135ca818", "a85f16a616834375aab7560727d33d5c");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "d7b67ecb882c43e1b50ef9d52fd62a4f", "ba7f2fdd782d4ac8baa6e5d0d8c0668c");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "soma");
			db_execute_sql(dbpv, sql);
		}
		else		/* i % 2 = 0 dendrite */
		{
			/* write the interaction_id between first and second object */
			sprintf(sql, "INSERT INTO Object_Interactions (Object_Interaction_ID, Object_ID) VALUES ('%s', '%s')", object_interaction_id, object_id);
			db_execute_sql(dboi, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "3169342e968a4f979cb821e4419c2520", "9121a51fafd449788c563b33a9ac64ef");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "30e-4");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "236c832aface444ca9805391cf9def17", "9121a51fafd449788c563b33a9ac64ef");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "30e-4");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "68ff54756ad34491ab95aaa71dfe2c63", "3f905435f4824d539327c1c5cc9acc40");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "-59.4");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "1906704a17fa473398b7a3dae5a2b013", "ed695ad4181347928611c6b9d2a3410e");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "a9dc2d7b5c024585a11636de04431775", "3f905435f4824d539327c1c5cc9acc40");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "-70");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "72999ab0a09145719a6de10b68c67313", "692cafddc34e4d22b886e28ae00b880a");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "10.0");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "226b8d30341f46bab8d36de6c939f16b", "696fc081f35d401fbf0052619aca133a");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "1.00");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "4924c4377f23425fba8a88a328f6497f", "dc01a06a5b03485bb71ade588c380a0a");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.05");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "39ae2d31712a4c6ead50a89a5aa4bb02", "3f905435f4824d539327c1c5cc9acc40");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "10.6");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "1fab5b8826a64302a0531c1d5a4869a9", "3f905435f4824d539327c1c5cc9acc40");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "334df63bdfea4199b9aaf68c34fe118e", "b9622b84193e415895b7975bbd1e59e8");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "57026a08960c4e958d363a43b2e9085e", "3d770ed0324843929a6b24611cd1656a");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "4b1dec6029c94078bb37376fb7f5cd79", "3f905435f4824d539327c1c5cc9acc40");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0.0");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "24f98f5d116f49d495b5cc34135ca818", "a85f16a616834375aab7560727d33d5c");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0");
			db_execute_sql(dbpv, sql);

			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "33b87fb6cf0547e793779df6ebcca013", "ed695ad4181347928611c6b9d2a3410e");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "0");
			db_execute_sql(dbpv, sql);
			
			uuid_create(object_property_id);
			sprintf(sql, "INSERT INTO Object_Properties (ID, Object_ID, Property_ID, Unit_ID) VALUES ('%s', '%s', '%s', '%s')", object_property_id, object_id, "d7b67ecb882c43e1b50ef9d52fd62a4f", "ba7f2fdd782d4ac8baa6e5d0d8c0668c");
			db_execute_sql(dbop, sql);
			sprintf(sql, "INSERT INTO Property_Values (Object_Property_ID, Time_ID, Property_Value) VALUES ('%s', '%s', '%s')", object_property_id, ID_SET_SIMULATION_TIME_STEP, "dendrite");
			db_execute_sql(dbpv, sql);
		}
	}	/* commit transactions */
	strcpy(sql, "COMMIT TRANSACTION");
	db_execute_sql(dbo, sql);

	/* define settings */	strcpy(sql, "INSERT INTO Settings (ID, Setting_Value) VALUES ('581066cf3c6b4c509d9800d8d27b1649', '2007-11-15-10-22-12-250');");
	db_execute_sql(dbo, sql);
	strcpy(sql, "INSERT INTO Settings (ID, Setting_Value) VALUES ('169096632f2f4fdf80a31df2c7ff13c2', '100');");
	db_execute_sql(dbo, sql);
	strcpy(sql, "INSERT INTO Settings (ID, Setting_Value) VALUES ('b75de57981424bcaa8d20a19c4cc1430', '2');");
	db_execute_sql(dbo, sql);
	strcpy(sql, "INSERT INTO Settings (ID, Setting_Value) VALUES ('2f8edd49824f44c5bb33a58cfee5bc9c', '0');");
	db_execute_sql(dbo, sql);

	/* free memory */	
	free(file_path);
	
	free(file_object_path);
	free(file_object_property_path);
	free(file_object_interaction_path);
	free(file_interaction_property_path);
	free(file_property_value_path);
	free(file_archive_property_value_path);

	free(sql);

	/* close database files */
	db_cache_close(file_object_id, SQLITE_OPEN_READWRITE);

	/* free memory */
	free(archive_property_value_id);
	free(property_value_id);
	free(property_id);
	free(interaction_property_id);
	free(object_interaction_id);
	free(object_property_id);
	free(object_id);	/* clear memory */
	int j;
		
	if (db_cache_list)
	{
		for (j=0; j<db_cache_count; j++)
		{
			/* only the key's memory must be freed */
			if (db_cache_list[j]->status == DB_MEMORY_ALLOCATED)
				free(db_cache_list[j]->key);

			free(db_cache_list[j]);
		}
			
		free(db_cache_list);
	}

	db_transaction_count = 0;
	db_cache_count = 0;	free(file_object_id);
	free(file_object_property_id);
	free(file_object_interaction_id);
	free(file_interaction_property_id);
	free(file_property_value_id);
	free(file_archive_property_value_id);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -