• 请不要在回答技术问题时复制粘贴 AI 生成的内容
yjsp1919
V2EX  ›  程序员

调用一个 Java 的算法,如何优雅地把出来的 var1234 这样排列的结果装进参数类

  •  
  •   yjsp1919 · Mar 11, 2024 · 1736 views
    This topic created in 802 days ago, the information mentioned may be changed or developed.

    那个 MOEA 多目标优化包例子非常直观 http://moeaframework.org/examples.html#example6

    但是这个算法包的变量只是按顺序排列 没有变量名 我又经常会改动变量的数量 这就导致我代码要改的地方很多

    比如最后结果是一个 NondominatedPopulation result = algorithm.getResult(); 所有东西都在这个 result 里 我想要保存到 excel 一但变量多了或者少了我就得手动修改保存 excel 的部分

    怎么才能做成那种 key value 的 而且最后结果要保存到文件 这个文件打开要比较直观能看到每个变量名字和值

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4189 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 10:10 · PVG 18:10 · LAX 03:10 · JFK 06:10
    ♥ Do have faith in what you're doing.