Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Ridepooling_Simulations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rhaag
Ridepooling_Simulations
Commits
f7b8b8e0
Commit
f7b8b8e0
authored
2 years ago
by
Ruben Haag
Browse files
Options
Downloads
Patches
Plain Diff
Pareto Check as notebook
parent
45bc2584
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pareto.ipynb
+161
-0
161 additions, 0 deletions
pareto.ipynb
with
161 additions
and
0 deletions
pareto.ipynb
0 → 100644
+
161
−
0
View file @
f7b8b8e0
{
"cells": [
{
"cell_type": "code",
"execution_count": 36,
"id": "f72cf662",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"parethoCheck (generic function with 2 methods)"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function paretoCheck(x, pointcloud, better= <)\n",
" # Usag: filter(x->parethoCheck(x, pointcloud), pointcloud)\n",
" for p in pointcloud\n",
" sum(better.(p,x)) == length(x) ? (return false) : nothing\n",
" end\n",
" return true\n",
"end\n",
"\n",
"#gib true zurück, wenn ein x_i besser ist als das entsprechende p_i für alle p_s, wo die reslichen p_j schlechter sind\n",
"# Paretho Optimal: x ist in einer Richtung besser, als alle, die in anderen Richtungen besser sind.\n",
"# Oder wenn ich einen Punkt finde, der in mehr als einer Richtung besser ist als x, dann ist \n"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "cbeb2c32",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"5-element Vector{Vector{Float64}}:\n",
" [1.0, 2.0]\n",
" [1.0, 4.0]\n",
" [0.5, 2.0]\n",
" [5.0, 6.0]\n",
" [1.0, 3.0]"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "90cd0638",
"metadata": {},
"outputs": [],
"source": [
"# Problem:\n",
"# Ich habe einen Index und muss darauf basierend einen \n",
"# Version A:\n",
"# Lege einfach alle Parameter zufällig fest (Gleichverteilt, mit vorgegebenen mini-und maxima)\n",
"# Version B:\n",
"# Umrechnen von 1D index in XD Parameterraums\n",
"# "
]
},
{
"cell_type": "code",
"execution_count": 74,
"id": "a3da0aa6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"rand_intervall (generic function with 2 methods)"
]
},
"execution_count": 74,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": 129,
"id": "6b2f66dc",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-0.6445598171068538"
]
},
"execution_count": 129,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n"
]
},
{
"cell_type": "code",
"execution_count": 63,
"id": "26a22574",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.7344013350577958"
]
},
"execution_count": 63,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"rand()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "287bb92b",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.6.2",
"language": "julia",
"name": "julia-1.6"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:code id:f72cf662 tags:
```
julia
function
paretoCheck
(
x
,
pointcloud
,
better
=
<
)
# Usag: filter(x->parethoCheck(x, pointcloud), pointcloud)
for
p
in
pointcloud
sum
(
better
.
(
p
,
x
))
==
length
(
x
)
?
(
return
false
)
:
nothing
end
return
true
end
#gib true zurück, wenn ein x_i besser ist als das entsprechende p_i für alle p_s, wo die reslichen p_j schlechter sind
# Paretho Optimal: x ist in einer Richtung besser, als alle, die in anderen Richtungen besser sind.
# Oder wenn ich einen Punkt finde, der in mehr als einer Richtung besser ist als x, dann ist
```
%% Output
parethoCheck (generic function with 2 methods)
%% Cell type:code id:cbeb2c32 tags:
```
julia
```
%% Output
5-element Vector{Vector{Float64}}:
[1.0, 2.0]
[1.0, 4.0]
[0.5, 2.0]
[5.0, 6.0]
[1.0, 3.0]
%% Cell type:code id:90cd0638 tags:
```
julia
# Problem:
# Ich habe einen Index und muss darauf basierend einen
# Version A:
# Lege einfach alle Parameter zufällig fest (Gleichverteilt, mit vorgegebenen mini-und maxima)
# Version B:
# Umrechnen von 1D index in XD Parameterraums
#
```
%% Cell type:code id:a3da0aa6 tags:
```
julia
``
`
%%
Output
rand_intervall
(
generic
function
with
2
methods
)
%%
Cell
type
:
code
id
:
6
b2f66dc
tags
:
```
julia
```
%% Output
-0.6445598171068538
%% Cell type:code id:26a22574 tags:
```
julia
rand()
```
%% Output
0.7344013350577958
%% Cell type:code id:287bb92b tags:
```
julia
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment