Matrice generer_solution(Matrice MTE,Matrice MEO,Matrice MED,Matrice MTP )
{
int base;
long cpt=1;
base =MTE.Length;
DynamicArray < int > tab_verite ;
Matrice solution;
for(int i=0;i<=MTE[0].Length-1;i++)
{
tab_verite.Length++;
tab_verite[i]=0;
}
float TES,TEP,MOY;
bool fin=false;
while (!fin) // generer les combinaison
{ TES=0;TEP=0;MOY=0;
FCout1(tab_verite,MTE,MTP,TES,TEP,MOY,MEO,MED,base);
solution.Length++;
solution[solution.Length-1].Length=MTE[0].Length+3;
solution[solution.Length-1][0]=MOY;
solution[solution.Length-1][1]=TES;
solution[solution.Length-1][2]=TEP;
for(int j=3;j<=solution[0].Length-1;j++)
{
solution[solution.Length-1][j]=tab_verite[j-3];
}
if ( cpt == pow(MTE.Length,MTE[0].Length))fin =true ;
tab_verite[0]=(tab_verite[0]+1)%base;
for(int i=1;i<=tab_verite.Length-1;i++) // teste d'arret
{
if ((tab_verite[i-1]==0)&&(!fin))
tab_verite[i]=(tab_verite[i]+1)%base;
else
break;
}
cpt++;
}
return(solution);
}
Partager