示例#1
0
        /// <summary>
        /// Add a new edge with vertexs a and b to the truss.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        public void LinkJoints(char a, char b)
        {
            int posA = a - 'a';
            int posB = b - 'a';

            if (posA > joints.Count || posB > joints.Count || posA == posB)
            {
                throw new Exception($"Joint '{a}' or joint '{b}' does not exist, " +
                                    $"or illegal connection of joints detected");
            }
            model.AddEdge(joints[posA], joints[posB]);
        }