本文介绍了家谱软件中的循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一些家谱软件(用 C++ 和 Qt 编写)的开发者.在我的一位客户寄给我一份错误报告之前,我没有遇到任何问题.问题是客户有两个孩子和他们自己的女儿,结果他因为错误而无法使用我的软件.

I am the developer of some family tree software (written in C++ and Qt). I had no problems until one of my customers mailed me a bug report. The problem is that the customer has two children with their own daughter, and, as a result, he can't use my software because of errors.

这些错误是我对正在处理的家庭图的各种断言和不变量的结果(例如,在走了一个周期后,程序声明 X 不能同时是 Y 的父亲和祖父).

Those errors are the result of my various assertions and invariants about the family graph being processed (for example, after walking a cycle, the program states that X can't be both father and grandfather of Y).

如何在不删除所有数据断言的情况下解决这些错误?

How can I resolve those errors without removing all data assertions?

推荐答案

您(和/或您的公司)似乎对家谱应该是什么有根本的误解.

It seems you (and/or your company) have a fundamental misunderstanding of what a family tree is supposed to be.

让我澄清一下,我也在一家公司工作,该公司的产品组合中有(作为其产品之一)家谱,我们一直在努力解决类似的问题.

Let me clarify, I also work for a company that has (as one of its products) a family tree in its portfolio, and we have been struggling with similar problems.

问题,在我们的情况下,我也假设你的情况,来自 GEDCOM 对家庭应该是什么非常固执己见的格式.然而,这种格式包含一些对家谱真正是什么样子的严重误解.

The problem, in our case, and I assume your case as well, comes from the GEDCOM format that is extremely opinionated about what a family should be. However this format contains some severe misconceptions about what a family tree really looks like.

GEDCOM 有很多问题,例如与同性关系不相容、乱伦等……在现实生活中,这种情况比您想象的更频繁(尤其是在回到 1700-1800 年时).

GEDCOM has many issues, such as incompatibility with same sex relations, incest, etc... Which in real life happens more often than you'd imagine (especially when going back in time to the 1700-1800).

我们根据现实世界中发生的事情对我们的家谱进行了建模:事件(例如,出生、婚礼、订婚、结合、死亡、收养等).我们对这些没有任何限制,除了逻辑上不可能的(例如,一个人不能是自己的父母,关系需要两个人等......)

We have modeled our family tree to what happens in the real world: Events (for example, births, weddings, engagement, unions, deaths, adoptions, etc.). We do not put any restrictions on these, except for logically impossible ones (for example, one can't be one's own parent, relations need two individuals, etc...)

缺乏验证为我们提供了一个更真实的世界"、更简单和更灵活的解决方案.

The lack of validations gives us a more "real world", simpler and more flexible solution.

对于这种特定情况,我建议删除断言,因为它们并不普遍适用.

As for this specific case, I would suggest removing the assertions as they do not hold universally.

为了显示问题(会出现),我建议根据需要多次绘制相同的节点,通过在选择其中一个时点亮所有副本来暗示重复.

For displaying issues (that will arise) I would suggest drawing the same node as many times as needed, hinting at the duplication by lighting up all the copies on selecting one of them.

这篇关于家谱软件中的循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 17:59
查看更多