Hello again every one , i am working on a project of solving a knapsack problem through genetic algorithm with AMPL
i defined the problem and solved with Default solver of AMPL and got the result but eight now
i am trying to solve heuristic with genetic algorithm
1) i made a random population of all possuible solutions
2) I check the fitness of them in my constraints
now that's time for make mutation and crossover parents to get new children but the problem in my coding is like
ITEM1 0
ITAM2 1
ITEM3 0
ITEM4 0
ITEM5 1
ITEM6 1
ITEM7 0
------------
ITEM1 1
ITAM2 0
ITEM3 0
ITEM4 0
ITEM5 0
ITEM6 1
ITEM7 0
------------
.
.
.
NOW i want them into a vector or matrice like this
S1=(0,1,0,0,1,1,0)
S2=(1,0,0,0,0,1,0)
etc
but i don't know how to assign result above to vector type or the code for this purpose
i would appreciate if you know and answer me