Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在任何逻辑项目中,我有一个参数数组,我想在每次模拟运行时将其中一个初始化为 1(其他参数初始化为 0)。事实上,我需要 N 次模拟运行,每次只有一个参数初始化为 1。我该怎么做?
你可以试试这个:myParam在 Main 上只创建 1 个参数,然后将当前的迭代次数从实验传递给 Main,使用getCurrentIteration()在实验属性中定义myParam.
myParam
getCurrentIteration()
在股票中,您可以编写一些代码,仅当它们符合 myParam 的要求时才将它们“打开”,如下面的股票 #3:
if (myParam==3) { work}
如果该参数实际上应该包含一个值来定义股票,则可以将其类型更改为 LinkedHashMap,其中键是迭代,值是股票的值。