hust-diangroup / ns3-ai

Enable the interaction between ns-3 and popular frameworks using Python, which mean you can train and test your AI algorithms in ns-3 without changing any frameworks you are using now!
GNU General Public License v2.0
220 stars 80 forks source link

64 bit numbers are implicitly converted to 32 bit #117

Open Kakadus opened 3 months ago

Kakadus commented 3 months ago

Hi, I wanted to use OpenGymBoxContainer<uint64_t> but the numbers were converted to 32 bit after loading the box from its protobuf message. 64bit wide numbers are handled in the corresponding python code:

else if (name == "uint8_t" || name == "uint16_t" || name == "uint32_t" || name == "uint64_t")
    {
        m_dtype = ns3_ai_gym::UINT;
    }

and c++ code

else if (name == "uint8_t" || name == "uint16_t" || name == "uint32_t" || name == "uint64_t")
    {
        m_dtype = ns3_ai_gym::UINT;
    }

but the protobuf messages only have 32bit wide integers. This does not work....

message BoxDataContainer {
    Dtype dtype = 1;
    repeated uint32 shape = 2;

    repeated int32 intData = 3;
    repeated uint32 uintData = 4;
    repeated float floatData = 5;
    repeated double doubleData = 6;
}

This is the same case with DiscreteContainer.