你好,
我想創建一個腳本,其中基於一些先前的輸入變量,DOE[] 對像被發送消息以與一個附加因素一起工作。
DOE 設計生成現在運行起來很繁重(大約 30 秒),因此我正在尋找一種精簡的方法(例如,在發送“製作設計”消息之前對其進行調整)。
理想情況下,我想使用 if 子句,檢查所述布爾變量是否為真,如果是,則將該因子添加到自定義設計中。
一些“偽代碼”:
AddSpecialFactor = 1; /* decision rule to add factor, will be retrieved from a modal window based on some more complex molecule chemistry input */
D = DOE(
custom design,
Add Factor(continuous, "A",.....),
Add Factor( ...),
..
If (AddSpecialFactor = 1) then Add Factor(....),
Add Term(),
..
If (AddSpecialFactor = 1) then Add Term() ...,
歡迎所有建議
以下是如何編寫此過程的示例。
Names Default to Here( 1 );
dialog = New Window( "Optional Factor", << Modal,
Outline Box( "Choice",
Text Box( "Add X4?" ),
Text Box( "Click OK to add" ),
Text Box( "Click Cancel to skip" )
),
H List Box(
Button Box( "OK" ),
Button Box( "Cancel" )
)
);
doe = DOE( Custom Design,
{Add Response( Maximize, "Y", ., ., . ),
Add Factor( Continuous, -1, 1, "X1", 0 ),
Add Factor( Continuous, -1, 1, "X2", 0 ),
Add Factor( Continuous, -1, 1, "X3", 0 ), Set Random Seed( 30650037 ),
Add Term( {1, 0} ), Add Term( {1, 1} ), Add Term( {2, 1} ), Add Term( {3, 1} ),
Add Term( {1, 1}, {2, 1} ), Add Term( {1, 1}, {3, 1} ),
Add Term( {2, 1}, {3, 1} ), Set Sample Size( 12 ), Simulate Responses( 0 ),
Save X Matrix( 0 )}
);
// add 4th factor and the associated main effect and interaction terms
If( dialog["Button"] == 1,
doe
<< Add Factor( Continuous, -1, 1, "X4", 0 )
<< Add Term( {4, 1} )
<< Add Term( {1, 1}, {4, 1} )
<< Add Term( {2, 1}, {4, 1} )
<< Add Term( {3, 1}, {4, 1} )
);謝謝拜倫,
從表加載是一個好主意。
儘管我必須調整模型,因為它作為 RSM 更複雜:它具有分支因素,如 Peter Goos 和 Bradley Jones 的出版物中所示:
Goos 和 Jones (2019) 存在嵌套因素的最佳實驗設計。 技術計量學。
https://doi.org/10.1080/00401706.2018.1562986
您是否還有示例,其中代碼以文本格式構建,然後用於評估()表達式。
喜歡:
DOECODE = "Part of the code " || if(..,) || etc...
.
.
DOEcommand = evaluate(DOECODE);
DOETable = (DOEcommand << Make Table);
這對於設計生成來說是一個很酷的想法。
我當時正致力於從 CSV 中獲取設計並生成 DOE。自動化設計生成
讓您的腳本概念生成一個數據表,然後使用上面博客中的腳本來加載和運行 DOE 平台可能會起作用。
也許獲取列名稱列表,如果該列表包含某些單詞,然後添加具有適當因子級別的列?