Monday, June 15, 2009

OPERRSEA Assigment

Operating Research


Quantitative analysis
Quantitative analyst in finance, someone who applies mathematics, among others stochastic calculus, to finance.
Quantitative analysis (chemistry), in analytical chemistry, the measurements of quantities of substances produced in reactions rather than simply noting the nature of the reactions
Quantitative analysis may also be:
Statistics and statistical analysis techniques rather than the use of mathematical material in social science.


Decision theory model
Decision theory in mathematics and statistics is concerned with identifying the values, uncertainties and other issues relevant in a given decision and the resulting optimal decision. It is sometimes called game theory
Normative and descriptive decision theory
Most of decision theory is normative or prescriptive, i.e., it is concerned with identifying the best decision to take, assuming an ideal decision maker who is fully informed, able to compute with perfect accuracy, and fully rational. The practical application of this prescriptive approach (how people actually make decisions) is called decision analysis, and aimed at finding tools, methodologies and software to help people make better decisions. The most systematic and comprehensive software tools developed in this way are called decision support systems.


Decision Trees
A decision tree (or tree diagram) is a decision support tool that uses a tree-like graph or model of decisions and their possible consequences, including chance event outcomes, resource costs, and utility. Decision trees are commonly used in operations research, specifically in decision analysis, to help identify a strategy most likely to reach a goal. Another use of decision trees is as a descriptive means for calculating conditional probabilities.



Linear Programming
In mathematics, linear programming (LP) is a technique for optimization of a linear objective function, subject to linear equality and linear inequality constraints. Informally, linear programming determines the way to achieve the best outcome (such as maximum profit or lowest cost) in a given mathematical model and given some list of requirements represented as linear equations.
More formally, given a polytope (for example, a polygon or a polyhedron), and a real-valued affine function
defined on this polytope, a linear programming method will find a point in the polytope where this function has the smallest (or largest) value. Such points may not exist, but if they do, searching through the polytope vertices is guaranteed to find at least one of them.

Sunday, February 15, 2009

ass. in THEODBS


SELECT DISTINCT it.name as Item i.name as Ingredients
From madewith as m, ingredients as i, items as it
Where (m.ingredientid = i.ingredientid)
And (m.itemid = it.itemid)
And ((quantity * 3) > inventory);

Sunday, February 1, 2009










Private Sub Command1_Click()
Dim rsu As ADODB.Recordset
Set rsu = New ADODB.Recordset
Dim li As ListItems

If ListView1.ListItems.Count = 0 Then
MsgBox "Please insert a Ingredients.", vbInformation
ListView2.SetFocus
Exit Sub
End If
If Label1.Caption = "" Then
MsgBox "Please press click.", vbInformation
Command4.SetFocus
Exit Sub
End If
If Len(Combo1) = 0 Then
MsgBox "Please insert a Item", vbInformation
ListView2.SetFocus
Exit Sub
End If

rsu.Open "select * from madewith", DataEnvironment1.Connection1, 1, 3
X = Val(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(4))
W = Val(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(2))
Do Until ListView1.ListItems.Count = 0

rsu.MoveNext
rsu.Fields("itemid") = Label1.Caption
rsu.Fields("ingredientid") = W
rsu.Fields("quantity") = X
rsu.Update
rsu.MoveNext
ListView1.SetFocus
ListView1.ListItems.Remove ListView1.SelectedItem.Index

Loop
rsu.Close

MsgBox "Save!", vbInformation, "Recipe Setup"
Text1.Enabled = True
Text1.Text = ""
Combo1.ListIndex = -1
Combo1.Enabled = True
Combo1.SetFocus
Command1.Enabled = True
Command3.Enabled = True
Label1.Caption = ""
ListView1.ListItems.Clear



End Sub



Private Sub Command2_Click()
Text1.Enabled = True
Text1.Text = ""
Combo1.ListIndex = -1
Combo1.Enabled = True
Combo1.SetFocus
Command1.Enabled = True
Command3.Enabled = True
ListView1.ListItems.Clear
End Sub


Private Sub Command3_Click()
If ListView1.ListItems.Count = 0 Then
MsgBox "There is no Item(s) in the list.", vbInformation, "System Info"
Else
ListView1.ListItems.Remove ListView1.SelectedItem.Index
End If

End Sub

Private Sub Command4_Click()
Dim q As String
Dim rscustoms As New ADODB.Recordset

If Combo1.ListCount > 0 Or Combo1.Text > "" Then
q = Combo1.Text
rscustoms.Open "select * from items where name='" & q & "'", DataEnvironment1.Connection1, 1, 3
If rscustoms.RecordCount > 0 Then
Label1.Caption = rscustoms.Fields("itemid")
End If
End If
End Sub



Private Sub Command5_Click()

End Sub

Private Sub Form_Load()
Dim rs As New ADODB.Recordset
Dim r As New ADODB.Recordset
Dim s As New ADODB.Recordset



If DataEnvironment1.Connection1.State = adstateclose Then
DataEnvironment1.Connection1.Open
End If
rs.Open "select* from ingredients ", DataEnvironment1.Connection1, 1, 3
If rs.RecordCount > 0 Then

Do While Not rs.EOF
ListView2.ListItems.Add , , Val(Text)
ListView2.ListItems(ListView2.ListItems.Count).SubItems(1) = rs.Fields("name")
ListView2.ListItems(ListView2.ListItems.Count).SubItems(2) = rs.Fields("ingredientid")

rs.MoveNext
Loop
End If


End Sub



Private Sub Label3_Click()
End Sub

Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
Cancel = 1
End Sub



Private Sub ListView2_BeforeLabelEdit(Cancel As Integer)
Cancel = 1
End Sub
Private Sub ListView2_DblClick()
Dim li As ListItem
Dim X As String
Dim rsc As New ADODB.Recordset
Dim Y As String


If ListView2.ListItems.Count <> 0 Then
Y = ListView2.SelectedItem.Text

rsc.Open "select * from ingredients where name='" & Y & "'", DataEnvironment1.Connection1, 1, 3
If rsc.RecordCount > 0 Then
With ListView3.ListItems
lv = ListItem

Set lv = .Add(, , Val(Text2))
lv.SubItems(2) = rsc.Fields("ingredientid")
lv.SubItems(3) = ListView2.SelectedItem.Text
End With
End If
End If


If Text1.Text = "" Then
MsgBox "Please type the quantity!", vbExclamation, "System Info"
Text1 = ""
Text1.SetFocus
Else
With ListView1.ListItems
z = Text1.Text
Set li = .Add(, , Val(Text2))
li.SubItems(1) = ListView2.SelectedItem.SubItems(1)
li.SubItems(2) = z
li.SubItems(3) = ListView2.SelectedItem.Text

End With
Text1.Text = ""
Text1.SetFocus
End If

End Sub

Private Sub ListView2_KeyPress(KeyAscii As Integer)
Dim li As ListItem

If Text2.Text = "" Then
MsgBox "Please type the quantity!", vbExclamation, "System Info"
Text2.SetFocus
Else
With ListView1.ListItems
Set li = .Add(, , Val(Text1))
li.SubItems(1) = ListView2.SelectedItem.SubItems(1)
li.SubItems(3) = ListView2.SelectedItem.Text
End With
Text1.Text = ""
Text1.SetFocus
End If
End Sub



Private Sub ListView3_BeforeLabelEdit(Cancel As Integer)
Cancel = 1
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
Command1.SetFocus
End If
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 And KeyAscii <> 46 Then

Chr (KeyAscii)

Else

KeyAscii = 0

End If
End Sub