I have two agents, distributers and suppliers. Each of these turtles have a number of variables which some of them are defined global to be able to be assigned to agents of another type. The question is that I am trying to solve a system of equations for the distributors using some of its variables as follows :(Sales and Coefficients are some variables of distributers which change in every run) DCoeffiecients = matrix A, sales = matrix C, and I am looking for Unknowns = matrix B (All the variables that I am calling inside the procedure are defined global)
sales = DCoefficients * Unknowns
I used "Matrix Extension" to solve it, but I run into this error " Expected a literal value" since I have variables not some constant numbers!
to Solve-quantity
ask distributers[
let A matrix:from-row-list [[Prod1coeff1 Prod1coeff2 Prod1coeff3 prod1coeff4] [[Prod2coeff1 Prod2coeff2 Prod2coeff3 prod2coeff4][Prod3coeff1 Prod3coeff2 Prod3coeff3 prod3coeff4][Prod4coeff1 Prod4coeff2 Prod4coeff3 prod4coeff4] ]
let C matrix:from-row-list [[S1] [S2] [S3] [S4]]
print matrix:solve A C
]end
How can I fix this error and assign variables to the matrix? Thanks