If you have something to separate your elevators from each other (When using =:=), you can get the cost for taking an order by:
1> cost_function:get( {"My elevator", 1, up}, {"Other elevator", 1, hall_down}, 4).
6
>2
Downloading does not work for elixir yet.
To add the cost-function to a rebar3-project, simply add the line/modify the deps-part of rebar.config to look like:
{deps, [
{cost_function, {git, "https://github.com/jornbh/erlang_cost_function", {tag, "v0.1.1"}}}
]}.
If you want to use the library in an Elixir-project, modify deps()
in mix.exs, so that it includes:
defp deps do
[
{:cost_function, git: "https://github.com/jornbh/erlang_cost_function", tag: "v0.1.1"},
]
end
There is slightly more info on how the module works in the documentation generated by rebar3 edoc
.