Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
225 views
in Technique[技术] by (71.8m points)

c++ - 家谱软件中的循环(Cycles in family tree software)

I am the developer of some family tree software (written in C++ and Qt).

(我是一些家庭树软件的开发者(用C ??++和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.

(问题是客户有两个孩子和自己的女儿,因此,他因错误而无法使用我的软件。)

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).

(这些错误是我处理家族图的各种断言和不变量的结果(例如,在走一个循环之后,程序声明X不能同时是Y的父亲和祖父)。)

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

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

  ask by Partick H?se translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

(让我澄清一点,我也为一家公司(其中一个产品)的产品组合中的家族树工作,我们一直在努力解决类似的问题。)

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.

(在我们的案例中,问题,我也假设你的情况,来自GEDCOM格式,该格式对于一个家庭应该是什么非常自以为是。)

However this format contains some severe misconceptions about what a family tree really looks like.

(然而,这种格式包含了一些关于家谱真正看起来的严重错误观念。)

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).

(GEDCOM有许多问题,例如与同性关系,乱伦等不相容......在现实生活中发生的事情比你想象的更频繁(尤其是回到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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...