We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d30f383 commit 183ab16Copy full SHA for 183ab16
src/rectangleguillotine/branching_scheme.cpp
@@ -1878,9 +1878,16 @@ nlohmann::json BranchingScheme::json_export(
1878
1879
Solution solution = to_solution(node, true);
1880
1881
+ auto parent = node->parent;
1882
+ while (parent != nullptr
1883
+ && parent->item_type_id_1 == -1
1884
+ && parent->item_type_id_2 == -1) {
1885
+ parent = parent->parent;
1886
+ }
1887
+ NodeId parent_id = (parent != nullptr)? parent->id: -1;
1888
nlohmann::json json = {
1889
{"Id", node->id},
- {"ParentId", (node->parent == nullptr)? -1: node->parent->id},
1890
+ {"ParentId", parent_id},
1891
{"Data",
1892
{
1893
{"ItemTypeId1", node->item_type_id_1},
0 commit comments