电网故障诊断通常基于保护和断路器的动作信息,并经遗传算法实现故障元件识别.该文在研究故障诊断模型特征的基础上,以基于泛型技术的标准模板库为核心,分别抽象出简单遗传算法的染色体类及遗传算法类,给出具体的遗传算子源代码,并结合具体故障实例验证诊断结果.通过与传统遗传算法的c++代码的对比,表明STL容器、迭代器及算法的使用不但增强了程序的可读性和健壮性,同时也降低了程序时间复杂度,最终达到提高电网故障元件识别速度目的.
Based on the operating information from protective relays and circuit breakers, the genetic algorithm be- comes the main method for diagnosing faults in power system. After studying the fault diagnosis model of power grid, the chromosome class, GA class and C + + code in the core of STL were abstracted, and a detailed fault di- agnosis result was validated. With the demonstration, the paper gives the judgement of the codes' legitimacy. By contrast with the C + + code of traditional method, it shows that the application of STL container, iterators and the algorithm not only boosts the readability and robustness of the software, but also reduces time complexity, and in the end increases the identification speed of power grid fault diagnosis.