How can I use a set with diffrent members as indexs? - julia

Pleas help me. I want to use a set by not order elements as indexes of some
variables. for example
I have
s=[2,3]
#constraint(ILRP,c7[ k=1:2,t=1:4],sum(x[i,j,k,t] for i=[2,3],
j=[2,3])<=size(s,1)-1)'
for index I ,j I want to use [2,3] as indexes. and I get for example this constraint:
x[2][2][k][t]+x[2][3][k][t]+x[3][2][k][t]+x[3][3][k][t]<=1
Thanks very much.

Related

Finding 'first occurrence' using Match Function in R

I am new to 'R' and 'Stackoverflow' so forgive me for the incredibly basic question. I'm trying to find the 'index' of the first female in my dataset.
Code Snapshot
My overall dataset is called 'bike', so first I thought it would be a good idea to assign a new vector of just the genders...
bike$genders
Then I tried using the function:
match(1, genders)
match(F, genders)
Neither of which worked! I know this is and should be relatively simple but I'm just starting out so I really appreciate your help.
Probably the most direct method would be to use
match("F", bike[,"genders"] which will return the index of the first match.
If you want to know the rows#, this should give you the rows, with their numbers printed to the screen, and you will see the index for rows with it.
bike[bike$gender=="F",]
and if you only want the row numbers to set to a vector
rnam<-row.names(bike[bike$gender=="F",])

How to change the value in a group of cells?

I'm wondering if it is possible to change the contents of multiple cells in a table using R?
Consider this example: Example
I need to change the values 'Femini.' to 'Feminine'. The problem is that i have a great number of cells to change... Is there some command that help me doing this?
Thanks for the help,
Luís
Say your dataframe is called df
df$Genre[df$Genre == 'Femini'] <- 'Feminine'

MS Access- Calculated Column for Distinct Count in Table Rather than a Query

I'd like to have a Calculated Column in a table that counts the instances of a concatenation.
I get the following error when inputting Abs(Count([concat])) as the column formula for the calculation: The expression Abs(Count([concat])) cannot be used in a calculated column.
Is there any other way to do it without doing a query? I'm pretty sure it can't be done but I figured I'd ask anyways since I didn't see any other posts about it.
No, and even if there was, you should create and use a query for this.
Besides, applying Abs on a count doesn't make much sense, as the count cannot be negative.

Jacop, constraint solver

I am a beginner in Jacop constraint solver. I looked into its documents but couldn't find how to solve my following problem. I have a matrix[n][n] of nxn domain variables of IntVar. Now, I need to apply the following constraint to it:
matrix[matrix[i][j]][k] == x
Here x is a regular integer, I mean not domain variable.
The problem that i am facing is that matrix[i][j] is a domain variable, and I am unable to give it as the first index in matrix[index][k] again.
I will really appreciate your help.
Basically you need to use element constraints to do that. First, create a vector matrix_k that represent a column k of matrix. Then, you can use Element constraint of the form Element(matrix[i][j], matrix_k, x).

Groupping in Gauge Panel, possible?

i am currently trying to Group Values given to Pointers in a Gauge Panel.
The Scenario Looks like this:
Now i have a dataset with the following Fields:
KPIName
KPIValue
I have all the Values in KPIValue, and I Group them with the field KPIName since i currently have 4 different KPIValues.
What i want to accomplish now is to put in 4 different Pointers in my GaugePanel and let them Show each KPIValue, meaning I want them to be Grouped, or at least let each pointer individually be Filtered to the KPIName it is supposed to Show.
I am working with GaugePanels for the first time, but it doesn't really seem possible to me for now,
Is there a solution ?
Is there a way ?
Or at least a Workaround ? (like adding custom fields to the Data Set, which are filtered by KPIName, or something similiar ?)
Thanks a lot for your Help!
Set the expression for the pointers to
=Sum(IIf(Fields!KPI.Value = "KPI1", Fields!Value.Value, 0))
=Sum(IIf(Fields!KPI.Value = "KPI2", Fields!Value.Value, 0))
=Sum(IIf(Fields!KPI.Value = "KPI3", Fields!Value.Value, 0))
...

Resources