Hello,
I am new to Julia and I have to create a vector which values are dependent. Let me put an example:
If I have MyStruct(22, [0, 0, 0], 0) , the next values can be MyStruct(21, [0, 0, 1], 0) , MyStruct(21, [0, 1, 0], 0) , MyStruct(21, [1, 0, 0], 0) , MyStruct(20, [0, 1, 1], 0) , MyStruct(20, [1, 0, 1], 0) … That is b::SVector{3, Int64} increases as a::Int decreases.
I tried to solve it by doing:
struct MyStruct
a::Int
b::SVector{3, Int64}
c::Int
end
V1 = [MyStruct(a,(b),0) for a in 0:15 for b in [Iterators.product(ntuple(_ -> 0:10, 3)...)...]] #Terminal states remaining time 0
But with this I get impossible things as MyStruct(22, [10, 10, 10], 0) .
Can you help me? Thanks ![]()