Coding for observation space using a list of values (openai gym) - reinforcement-learning

I have a tuple of tuples as my observations space that each item corresponds to an action for that space.
Think of a long panel with button that can have multiple discrete values and I can switch any one of them. If the panel has 10 items then my action spaces is
self.action_space = spaces.Discrete(10)
What I want to do is simplify my observation_space in such a way that I can provide my list of discrete values. How do I define that?
PS: my observation space is currently a list of 10 values (categorical), each distinct within its space. e.g., the first can take only A and B, the second can only take C and D, and so on.

You're looking for Multi Discrete Action Space

Related

SSRS range bar chart, different color when no data

I am looking to change the color in the "gaps" in the range chart that I have built.
Essentially I am trying to build a visualization for the staff to see the availability on bays. The red markings mean the bay is booked, I wanted green then to be in between the red to highlight free bays.
Occupied bays:
I suspect I need to go back to my dataset and add in some date tables to show "null data" to allow a "switch" to work, but I thought someone might know if I could change this without going this way.
An example of the dataset would be:
Following up
here is a screen shot of my output, i added data labels to see if i was going wrong...HOWEVER I also added shadows to my data and my data is actually still there, just hiding behing my secondary bars......
you are right about my data set, i had to add a series grouping to get my appointments all to appear other wise i was just getting the first appointments on the row only to appear....
Following up 2
A further follow up, I have followed #iamdave 's excellent RangeChart.RDL
I have applied my dataset to it but I am now getting the following output, I know I am probably missing something simple, my gut is telling me the cust_id are seperating all the appointments on to seperate lines yet I have both the primary and secondary axis set to "DrawSideBySide = False"
Here is my set up..
here is my latest output, if I could just group all the rows/bars/lines down to the 6 bays it would be great.
You can do this by adding in another data series based on your original dataset, that will require significantly less processing than filling in all your empty periods as suggested by WEI_DBA.
In your dataset, add a new column that returns dense_rank() over (order by BAY) as BayID (order by should be your desired axis label).
This may be best done as a wrapping select statement to preserve the rest of the query logic as is.
In your Range Chart, add in another Values item, with the same Category Field as your current one.
Set the Top Value to 1 and your Bottom Value to 0.
You could also set this to the min and max time of your dataset or the start and end period of your report to only cover the period the Bay was available.
Set it to display on the Secondary Axis for both Vertical and Horizontal axes.
Also select the Do not show this series in a legend option.
Set up the Secondary Vertical Axis in exactly the same way as your Primary Vertical axis.
Set the Secondary Horizontal Axis Minimum and Maximum to the same values as your Bottom and Top above.
Hide both the Secondary Axes.
Select the new Values item and in the Properties window, expand the CustomAttributes section and change DrawSideBySide to False.
If necessary, adjust the order of the Values items in your Chart Data window to make sure the new Range Bar displays underneath your actual data.
Select the original Values item and in the properties sidebar navigate to Data > DataPoint:
Change AxisLabel to =Fields!BAY.Value (Your axis label).
Change Values > X to =Fields!BayID.Value (Value from point 1.).
You should now have a range chart that that displays your data on top of a solid bar, that you can set to any colour you require:

How can I add TextBoxes to an existing Matrix in an SSRS project?

Why is it that a control that appears in the property list in a BIDS project is not represented in the corresponding .rdl file?
Let me step back a bit; I'm having a heck of a time trying to figure out how to add items to an existing report, either via the XML (.rdl viewed as code) or on the design surface. I can click on a rectangle on the design surface and see a column row above it:
And if I click on the "pipe"-separated segements on that column heading row, I see "MatrixColumn4", "MatrixColumn3", "MatrixColumn2", and "MatrixColumn1" in the designer; for example, here's MatrixColumn3:
However, only one of these columns appears at a time in the Property list - if I select MatrixColumn3 on the design surface, MatrixColumn1, MatrixColumn2, and MatrixColumn4 are not there. The same holds true for selecting any of the others - it turns up temporarily in the Properties list but "hides" all the others:
Stranger yet, when I search the .rdl file (viewed as XML) for "MatrixColumn1" (or "2" or "3" or "4") they do not exist there. In fact, the only reference to "MatrixColumn" in the entire file is this:
<Matrix Name="matrix1">
<MatrixColumns>
<MatrixColumn>
<Width>1.67609in</Width>
</MatrixColumn>
</MatrixColumns>
. . .
This seems exceedingly bizarre - shouldn't there be four sets of <MatrixColumn></MatrixColumn> there?
I want to add another column heading, with a Textbox-as-label and a Textbox below that to display dynamic content, but how can I do it without adding another column heading?, or at least making room for this new column?
I can increase the width of the matrix ("matrix1") by dragging it or by increasing its Size.Width value, but its existing contents expand with it, giving me no room to add TextBoxes inside of it.
Maybe I'm approaching SSRS from a completely wrong mental angle, as I don't see much of a connection between what the report generates and what I see on the design surface and in the XML.
To add another column to a matrix right click the column header and Select Insert column. Then choose either inside group (left or right), or outside group (left or right).
A column created inside the group will repeat for every item in the column group
A column created outside the group will only appear the once to the left or right of the grouped columns.
Are you sure you are referring to a matrix (dynamic columns and rows) and not a tablix (dynamic number of rows only)?
The process for tablixes is the same as for matrixes as described above, just without the inside/outside group option.
Either method described above will include a new column with a single text box to label the column with, and another text box underneath to put the detail in.
You can also do this process by dragging a field from your dataset in the Report Data panel to the appropriate location in your existing table.
Please let me know if this helps, or if I've misunderstood your question and you require a different solution.

How can I make a simple flow chart in SSRS?

I come to you with a question on how I can create a simple flow chart like in the pictures below in SSRS. I have a query that returns rows with events, and a date column that I can use to organize these events in chronological order.
I have it all basically set up but I am running into a design problem. I have a tablix with two columns in a group for the box+arrow combination, with column visibility set up to hide the arrow if it reaches the last event. What I would like to happen is for the boxes to reach the end of the page (the rightmost side of the page, and then come down a short distance below that row of boxes and continue on the same page (Ex. B). What it's doing is reaching the end of the side of the page, and breaking to the next page, effectively creating a bunch of pages with only one row of boxes on each page. (Ex. A)
Ex. A: What it does:
Ex. B: What I want it to do (accidentally forgot to include the arrow on the middle rightmost box in the picture, the second and third rows are just continuations of the first obviously):
I would almost call it row wrapping but it's not exactly the same. To bring the problem away from my specific flow chart design, I want to make tablix columns wrap down directly below the table (not the content inside the columns, the actual columns themselves).
I've done some reading on column groupings and interactive page size. I don't really understand the column grouping manipulation, especially when trying to apply it to my situation, and the interactive page size doesn't seem to be what I am looking for either. Any help on this would be really appreciated!
I suggest you use a multi-column layout, e.g.
http://nederveld.wordpress.com/2010/02/15/how-to-do-a-column-layout-in-sql-reporting-services/
Each of your Box + Arrow pairs would go into each cell.
I'm a bit confused about your arrow requirement, you might need to use an expression based on RowNumber to hide the arrow in the last column.

Set max lines displayed in WebI BO report

How would I set a maximum lines to display in a BO 4 report? On each page, I'd like to show 20 account numbers in column 1 with item counts in the next columns. There are some good discussions on limiting the rows retrieved in a query (e.g., Limit number of result or rows returned in BO using WebI). Some suggestions include using sections with RowIndex()/20 to limit the lines to 20, so I tried adding a variable =Floor(RowIndex()/20). However, the lines in my report contain aggregated variables, and the row index counts all records retrieved. Thoughts?
One option:
Add a column on the far left of the block. Use the following formula:
=Floor(RunningCount([Account Number])/10)
(assuming, of course, that your dimension is named [Account Number])
Create a break on this column. (Report Element -> Table Layout -> Break -> Add Break). Go back to the same menu and click Manage Breaks. Click the "Start on a new page" checkbox.
This will create a block with a maximum of 20 rows per page. Unfortunately, there's no direct way to hide a column in WebI, so you'd be stuck with this ugly column. What you can do, however, is remove all borders, change the font to white-on-white, and reduce its width as much as possible.

SSRS 2008 - charts by groups with matrices underneath

The report user wants to have groups by business unit and within each group they want to chart a set of same 4 metrics one under another: metric1, metric2... metric4. Under each of the merticN chart they want a matrix showing metricN values in rows where the months are the columns (metricN is actually 3 metrics: current month's, YTD and previous YE which is the same for every month).
Question: I know that it is possible to use list, bound to a group, to show charts by groups. Is it possible to insert a matrix for the same group under the chart (not to the right of it)?
I tried inserting nested rectangles, but a matrix inside a nested rectangle can no longer be bound to the same dataset, needless to say to the group (dataset is disabled).
As a proof of concept I can build a matrix with a chart inside the proper group, which does not solve the task of putting charts above the data. The charts, even so small, look fine in design, but in preview mode SSRS plays some dirty tricks. The resulting chart (occupying 100% of the group box and leving no space for group title, of course) is very ugly - horrible combination of scaling (why?!) and being squeezed into a small area. It looks like SSRS is going mad when a chart is in a confined space. The charts are stretched vertically and horizontally, the lines are thick and fuzzy. Only those charts, that end up in a partial group at the end of the page, look OK from graphical POV.
The most scandalous part is that even though data is correctly groupped by the matrix and reflected in the axis auto-scaling ticks and legends, it is not plotted. The charts remain empty. There must be some 'advanced option' hidden somewhere that is necessary for the charts to work within a matrix, or it is simply bugged.
Edit:
The best I've done so far was adding a Total row above a group and inserting a chart into that cell. It is somewhat closer to the requirement with several drawbacks:
The chart is only above the group name, not above whole matrix
Due to p.1 the chart cannot be made large enough
The matrix's column headers are separated from matrix data by the area
height of the chart
However the chart is still not plotting data. Playing with Category/Series Groups 'Synchronize group in' property is not helping.
To have a chart per group and group data in a matrix one on top of another, one should create a list and insert the required row groups with header rows. Then make group columns except the innermost hidden, delete the detail row and insert both chart and matrix into the innermost child group.
Then put the group fields into the group header cells.
This way the group titles appear at the beginning, then the chart, then the matrix and the last two are repeated in every child group.