ikaros-project / ikaros

An open infrastructure for system level brain modeling
GNU Affero General Public License v3.0
22 stars 23 forks source link

Setsizes() #201

Closed birgerjohansson closed 2 months ago

birgerjohansson commented 2 months ago

Is this possible to do with the new ikaros? Output should be 16x (max length of MATRIX_1 or MATRIX_2)

void Transform::SetSizes() { int sy1 = GetInputSizeY("MATRIX_1"); int sy2 = GetInputSizeY("MATRIX_2");

if(sy1 == unknown_size || sy2 == unknown_size)
    return;

int sy = max(sy1, sy2);

SetOutputSize("MATRIX", 16, sy);
SetOutputSize("OBJECT_ID", sy);
SetOutputSize("FRAME_ID", sy);

}

ikaros-project commented 2 months ago

This is not possible. We could add functions like max to the size values in the ikc but we would need to motivate it with more use cases.

ikaros-project commented 2 months ago

We need to bring back SetSizes in modules in situations where the size it not known before Init().

ikaros-project commented 2 months ago

New (untested) version:

void
Transform::SetSizes()
{
   Bind(m1, "MATRIX_1"); // Assuming matrices are already defined
   Bind(m2, "MATRIX_2");
   Bind(m, "MATRIX");
   Bind(object_id, "OBJECT_ID");
   Bind(frame_id, "FRAME_ID");

   im1.empty())
        return;

   if(m2.empty())
        return;

    int sy = std::max(m1.size_y(), m2.size_y());
    m.realloc(16, sy); // Possibly the wrong order **** sy, 16?
    object_id.realloc(sy);
    frame_id.realloc(sy);
}
ikaros-project commented 2 months ago

SetSizes will be completely removed again and replaced with function that sets parameters that can be accessed by the size attribute instead.