The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
Hello there,
Here is how Operator.setParameter(String key, String value) works.
The first argument is the key, or the name of the parameter. The type is String, and usually, we refere these keys in the way
ClassName.KEY_NAME
e.g.
ImprovedNeuralNetLearner.PARAMETER_HIDDEN_LAYERSRandomGenerator.PARAMETER_USE_LOCAL_RANDOM_SEED
In this way, you may code quicker, avoid type mistake, and keep your program stable.
The second argument is also a String, for the value of this parameter. This means even for numerics or booleans, you should cast them in to String.
e.g. "true", "0".
Here is an example that may help you know how to set and retrieve parameters:
// here we set the parameter using the method setParameter(String key, String value); // ""+int is just a quick way to convert single int into a string opt.setParameter(AttributeSubsetSelector.PARAMETER_FILTER_TYPE, ""+(AttributeSubsetSelector.CONDITION_ALL)); // now lets test whether the value is set String s = opt.getParameterAsString(AttributeSubsetSelector.PARAMETER_FILTER_TYPE); System.out.println(s); // actually you can also get the parameter as an integer or other applicable data type int i = opt.getParameterAsInt(AttributeSubsetSelector.PARAMETER_FILTER_TYPE); System.out.println(i);
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…
Join us for a community conversation on accelerating your motor simulation workflow with Simcenter Simlab. In this beginner-friendly session, we'll introduce the platform's automated model-building capabilities and show how easy it is to set up your first electric motor analysis. You'll see the basic steps of geometry…
Join us for a Community Conversation where we'll discuss practical approaches to analyzing complex electromagnetic models using hybrid solver techniques. This session will provide a general overview of how different computational methods can be combined within a single simulation to address models containing varied…