Linking radio buttons to select groups of schedules in Anylogic - radio-button

I am trying to link a radio button which allows the model user to select an operating scenario for the simulation (scenario A-E), and I need this radio button selection to provide conditional control to specify which rate schedule is to be applied by each source block.
i.e. if Operating Scenario A radio button is selected, Source 'WestboundArrival' uses arrival schedule A1, Source 'EastboundArrival' uses arrival schedule A2 etc
I am struggling to find a previous example of how to tackle this.
I think that an approach whereby the radio button selection outputs a variable using the 'Action' tab, and using this variable output to select the rateschedule used by the source. I am having difficultly in creating a link.
Any pointers would be welcomed.

You can just add a parameter "choice" and link this to the radiobutton (make sure its an int).
Then in your sourceblock you can add code like this:
choice==0?schedule:schedule1
If you now run your model, the rate schedule used by source will be selected based on your radiobutton selection. You can also change it during runtime.
And please be aware that the radiobutton index is zero based, so the button defined first is 0, next one is 1 etc.
Good luck!

Related

Object identification and replay in UFT

If suppose there two or more controls(eg. Buttons) with exactly same properties on a screen and while recording user actions if one of the controls was clicked, how can the appropriate control be identified and replay back the same click by overcoming the ambiguity of that control?
Scenario:
Two 'cancel' buttons without an automation id or any useful assistive properties and let's say their hierarchy(ancestors) are same.
Replay script is being executed in UFT.
If UFT creates the objects, either via Record or by adding the object to repository, it will automatically add an ordinal identifier. This is a numeric value that selects the controls from the set of controls that match the (rest of the) description. The ordinal is usually based on the placement of the control (starting on the top left) and may not be the most robust way to identify the control.
It's probably better to use Visual Relations Identifier (VRI) which allows describing the control in relation to another control. This is similar to how a human would describe the button, e.g. "The cancel button to the left of the 'are you sure' text".

Radio buttons used in a rad grid in batch edit mode

I am trying to find any information about using a radio button in a rad grid in batch edit mode. I have created a template column, then added the radio button control, but it doesn't work in batch edit mode (nothing saves back to the DB). Is it even possible? I can't find anything on the Telerik site so I am suspecting its not supported. Thanks.
The Radio list is not supported in the batch editing mode. Such integration simply has not been implemented. The closest available option at this time is using a dropdown list: http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx. Generally speaking, the standard way of editing boolean fields is through a checkbox column and not a radio button list - check the Discontinued checkboxes column.
What the grid does is that it loops through the controls with JS code when cells are opened and closed and determines control types and the proper API to use (e.g., $get().control.get_value() for dropdownlists, or $get().value for standard inputs). You can try implementing similar logic in the batch editing events.
You can try to use a RadRadioButtonList with the two items declared in its markup and its client-side API (see the get_selectedIndex() and set_selectedIndex() method: https://docs.telerik.com/devtools/aspnet-ajax/controls/radiobuttonlist/client-side-programming/radiobuttonlist-object) together with the following approach of working with templates: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/working-with-templates.
The idea is to have the radio button list in the edit template of the column and to select the correct item in it according to the newly opened cell value on the client, then fetch the selected item from the button list and put it in the grid data source.
You can find one example that you can try using as base in the following thread: https://www.telerik.com/forums/radiobuttonlist-in-gridtemplatecolumn.
Showing a radio button list in the item template is also something that is not supported, as the editing would basically happen in the "display" mode of the cell, and not in the edit mode of the cell. You could try using the server ItemDataBound event and FindControl() (see here: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-template-column) may let you set initial values based on the data source for the radio button lists without data binding them. Then, perhaps a hidden field or hidden checkbox can be used for the actual data binding (see the template article above). You could also try using the batch editing manager changeCellValue() method on the client-side events of the radio button list, in a fashion similar to this article: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/how-to/editing-checkboxes.
Another approach you can consider is to use the client-side events of the radio button list and immediately upon change to call a service that will update the database. This may simplify the template handling logic (you could do this in a read-only column) but it goes against the purpose of batch editing to invoke one request with a lot of data, and you would also need to secure the service.
Another online resource to check is
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/how-to/editing-checkboxes

Anylogic PLE: I want a slider or other control to affect the arrival schedule for my source in anylogic

I am doing my thesis using Anylogic and I've run into a little problem. I have two different schedules for my source, in the process modeling section. I want/need a control option such as a slider to affect the used schedule in the source block. Is there a way to do this?
Thank you in advance,
a student in need
Sure, there are many different ways and this is a quick way:
create a radio button control called radioas below:
Obviously, create 2 schedule objects, here named schedule and schedule2.
In your source, switch the schedule selection to a dynamic property where you can add code. Write as below:
Now the source applies the schedule you select in the radio button at any time.
cheers

How to enable datasheet’s filter triangle button in continuous form

Is it possible to use the built in triangle button to filter records for datasheet form in continuous forms?
If not. Then do you think if it is possible to code such a feature?
Also, is it possible to add a select all button within the datasheet form itself instead of placing it in a form containing the datasheet as a subform?
I’m afraid I have no choice but to use continuous forms because of how limiting datasheet forms are.
No, this is not an available feature. Also, no workarounds are available.
You can add an image with the filter icon and try to determine if the column is filtered, but that's both very difficult and not very useful (since you can't get the dialog to adjust the filter when you click on it).
If you want the filter dialog, however, you can just right click one of the fields to add a filter or adjust an existing filter.

icCube - MDX - How can I create a filter in a Histogram using a button named "MONTH"

I need to create a filter between some buttons named and a histogram, so for example when I click on "Mois" the histogram will change automatically to show us the Months.
Not sure to understand your question. Each widgets has a set of events that can be generated (Event tab, 'on Row Click', 'on Cell Click ...).
Once the event has been defined with a name, 'histogram-click', in can be used mainly everywhere with #{eventName!defaultValue}. This will be replaced by icCube once the event changes. Check here for a little more documentation.
Also, in Configuration/Report Javascript you can add some code that is called on event generation for more dynamic behavior (e.g. using jquery to change the page).
hope it helps