?? afsa.h
字號(hào):
#pragma once
#include"math.h"
#include"time.h"
struct Fish_Class{
int *Position;
int Amount_Of_Neighbour;
float Food_Consistence;
};
struct Question_List_Class{
int Question_Value;
int Question_Number;
int Question_Hard_Level;
int Number_Of_Cover_Knowledge;
long *Knowledge_Number_List;//葉子知識(shí)點(diǎn)!!!!
};
class AFSA
{
public:
AFSA(int Visual,int Try_Number,Question_List_Class* Question_List,int Number_Of_Question,long* Knowledge_Number_List,int Number_Of_Knowledge,int Want_Hardest,int Want_Hard,int Want_Normal,int Want_Easy,int Want_Easist,float Level_Weight=1.0,float Cover_Weight=1.0,float Point_Weight=1.0,int Number_Of_fish=0,float Delta=1.0);
~AFSA(void);
protected:
//人工魚數(shù)組
Fish_Class *Fish;
// 人工魚的可視域,表示與自己有幾位不同的魚在可視范圍內(nèi)
int Visual;
// 擁擠系數(shù)
float Delta;
// 覓食時(shí)的搜索次數(shù)
int Try_Number;
// 人工魚的條數(shù)
int Number_Of_fish;
// 表示兩條魚之間是否可見
int** Relation_Of_Fishes;
//人工魚的維數(shù)
int Amount_Of_Dimension;
public:
// 設(shè)置某條魚的食物濃度,魚在數(shù)組中的號(hào),魚的食物濃度
int Set_Food_Consistence(int Symbol_Of_Fish, float Food_Consistence);
int Rand_Move(int Symbol_Of_Fish);
protected:
// 難易度優(yōu)化權(quán)值
float Level_Weight;
// 知識(shí)點(diǎn)覆蓋權(quán)值
float Cover_Weight;
// 總分差權(quán)值
float Point_Weight;
public:
float Get_Food_Consistence(int* Position,int &Most_Hard_Level_Difference,int &Amount_Difference,float &Cover_Difference);
protected:
// 知識(shí)點(diǎn)數(shù)
int Number_Of_Knowledge;
// 考試范圍內(nèi)的全部葉子知識(shí)點(diǎn)列表
long* Knowledge_Number_List;
// 考試范圍內(nèi)全部試題列表
Question_List_Class* Question_List;
// 希望的難題分值
int Want_Hardest;
// 希望的較難題目的分值
int Want_Hard;
// 希望的普通題分值
int Want_Normal;
// 希望的較簡(jiǎn)單題分值
int Want_Easy;
// 希望的簡(jiǎn)單題分值
int Want_Easist;
public:
// 計(jì)算第Symbol_Of_Fish條魚和其它魚的相鄰關(guān)系
int Set_Neighbour(int Symbol_Of_Fish);
// 覓食
int Prey(int Symbol_Of_Fish);
// 聚群
int Swarm(int Symbol_Of_Fish);
// 追尾
int follow(int Symbol_Of_Fish);
protected:
// 公告板
Fish_Class Bulletin_Board;
public:
// 尋找最優(yōu)解,試題列表以-1為結(jié)尾,try_number為迭代次數(shù),負(fù)數(shù)表示最大迭代時(shí)間,Want_Most_Hard_Level_Difference可容忍的各難度部分最大分值差異,Want_Amount_Difference可容忍總分差異,Want_Cover_Difference可容忍知識(shí)點(diǎn)未覆蓋率
int move(long double Try_Number,long *&Questions,int Want_Most_Hard_Level_Difference,int Want_Amount_Difference,float Want_Cover_Difference);
// 僅用于測(cè)試
void test(void);
};
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -