Commit 918917c3 authored by Bjarno Oeyen's avatar Bjarno Oeyen

pizilla changes

parent 3421c467
......@@ -19,19 +19,22 @@
use Mix.Config
config :marlon,
python_path: 'python'
python_path: 'python',
visualization: nil,
communication_time: 1000,
processing_time: 100
config :libcluster,
topologies: [
load_balancing_demo: [
# strategy: Cluster.Strategy.Gossip,
strategy: Cluster.Strategy.Epmd,
# config: [hosts: [:"master@192.168.1.100", :"aux@192.168.1.100"]],
config: [hosts: [:"master@192.168.0.172", :"aux@192.168.0.172", :"aux2@192.168.0.172"]],
config: [hosts: [:"master@192.168.1.200"]],
config: [hosts: [:"master@192.168.0.172", :"aux@192.168.0.172", :"aux2@192.168.0.172"]],
# connect: {Marlon.Network, :connect_node, []},
# disconnect: {Marlon.Network, :disconnect_node, []},
]
]
config :logger,
level: :info
\ No newline at end of file
level: :info
......@@ -31,7 +31,7 @@ defactor LoadBalancingExample do
Logger.info "Communication time: " <> Integer.to_string(Application.fetch_env!(:marlon, :communication_time))
Logger.info "Processing time: " <> Integer.to_string(Application.fetch_env!(:marlon, :processing_time))
vis_pid = if (Application.fetch_env!(:marlon, :visualization)) do
vis_pid = if (Application.fetch_env!(:marlon, :visualization)) do
Process.whereis(:broker_node)
else
nil
......@@ -231,4 +231,4 @@ defgoal ChunkSizeGoal do
params [explorations: 7, steps: 20]
actions [process_chunk: [[1,2,3]]]
reward fn(_agent, worker_state) -> 1 / worker_state[:wait_time] end
end
\ No newline at end of file
end
......@@ -30,16 +30,25 @@ defmodule Marlon.Application do
## Application initialisation
def start(_reason, _args) do
Logger.info "hello there application!"
# Check whether this is the node initiated the Marlon system
node_name = Atom.to_string(Node.self())
children = if (String.contains?(node_name, "aux")) do
topologies = Application.get_env(:libcluster, :topologies)
children = if ((String.contains?(node_name, "aux")) || (String.contains?(node_name, "slave"))) do
Logger.info "Starting Marlon on auxiliary node"
[{__MODULE__, []}]
[{__MODULE__, []},
{Cluster.Supervisor, [topologies, [name: MyApp.ClusterSupervisor]]},]
else
Logger.info "Starting Marlon on primary node"
[{__MODULE__, []},
%{id: :agentgroups, start: {Marlon.AgentGroupManager, :start_link, [[], [name: :agentgroups]]}}]
%{id: :agentgroups, start: {Marlon.AgentGroupManager, :start_link, [[], [name: :agentgroups]]}},
{Cluster.Supervisor, [topologies, [name: MyApp.ClusterSupervisor]]},]
end
Supervisor.start_link(children, strategy: :one_for_all)
......@@ -53,4 +62,4 @@ defmodule Marlon.Application do
{:ok, args}
end
end
\ No newline at end of file
end
......@@ -41,7 +41,7 @@ defmodule Marlon.Mixfile do
# Run "mix help deps" to learn about dependencies.
defp deps do
[
# {:erlport, "~> 0.10.0"},
{:erlport, "~> 0.10.0"},
{:libcluster, "~> 3.0.2"},
# {:smile_it_demo_ui, git: "https://github.com/rhumbertgz/smile_it_demo_ui.git"},
# {:exprof, "~> 0.2.0"},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment