CYCAMORE
Loading...
Searching...
No Matches
test_regression.TestDynamicCapacitated Class Reference
Inheritance diagram for test_regression.TestDynamicCapacitated:
test_regression.TestRegression

Public Member Functions

 setup_class (cls)
 
 teardown_class (cls)
 
 test_sink_deployment (self)
 
 test_source_deployment (self)
 
 test_xaction_general (self)
 
 test_xaction_specific (self)
 
- Public Member Functions inherited from test_regression.TestRegression
 find_ids (cls, spec, a, spec_col="Spec", id_col="AgentId")
 
 to_ary (cls, a, k)
 

Public Attributes

int agent_ids = cls.to_ary(cls.agent_entry, "AgentId")
 
 agent_impl = cls.to_ary(cls.agent_entry, "Spec")
 
 depl_time = cls.to_ary(cls.agent_entry, "EnterTime")
 
int exit_ids = cls.to_ary(cls.agent_exit, "AgentId")
 
 exit_time = cls.to_ary(cls.agent_exit, "ExitTime")
 
 quantities = cls.to_ary(cls.resources, "Quantity")
 
 receiver_ids = cls.to_ary(cls.transactions, "ReceiverId")
 
 resource_ids = cls.to_ary(cls.resources, "ResourceId")
 
 sender_ids = cls.to_ary(cls.transactions, "SenderId")
 
int sink_id = cls.find_ids(":cycamore:Sink", cls.agent_entry)
 
int source_id = cls.find_ids(":cycamore:Source", cls.agent_entry)
 
 trans_resource = cls.to_ary(cls.transactions, "ResourceId")
 
int trans_time = cls.to_ary(cls.transactions, "Time")
 
- Public Attributes inherited from test_regression.TestRegression
 agent_entry = f.get_node("/AgentEntry")[:]
 
str agent_exit
 
 compositions = f.get_node("/Compositions")[:]
 
 conn = sqlite3.connect(cls.outf)
 
 cur = cls.conn.cursor()
 
str enrichments
 
str ext = '.sqlite'
 
 inf = inf
 
 info = f.get_node("/Info")[:]
 
str outf = str(uuid.uuid4()) + cls.ext
 
 resources = f.get_node("/Resources")[:]
 
dict rsrc_qtys
 
 transactions = f.get_node("/Transactions")[:]
 

Detailed Description

Tests dynamic capacity restraints involving changes in the number of
source and sink facilities.

A source facility is expected to offer a commodity of amount 1,
and a sink facility is expected to request for a commodity of amount 1.
Therefore, number of facilities correspond to the amounts of offers
and requests.

At time step 1, 3 source facilities and 2 sink facilities are deployed, and
at time step 2, additional 2 sink facilities are deployed. After time
step 2, the older 2 sink facilities are decommissioned.
According to this deployment schedule, at time step 1, only 2 transactions
are expected, the number of sink facilities being the constraint; whereas,
at time step 2, only 3 transactions are expected, the number of source
facilities being the constraint. At time step 3, after decommissioning 2
older sink facilities, the remaining number of sink facilities becomes
the constraint, resulting in the same transaction amount as in time step 1.

Definition at line 259 of file test_regression.py.

Member Function Documentation

◆ setup_class()

test_regression.TestDynamicCapacitated.setup_class ( cls)

Reimplemented from test_regression.TestRegression.

Definition at line 279 of file test_regression.py.

References setup_class(), and test_regression.skip_if_dont_allow_milps().

Referenced by setup_class().

◆ teardown_class()

test_regression.TestDynamicCapacitated.teardown_class ( cls)

Reimplemented from test_regression.TestRegression.

Definition at line 303 of file test_regression.py.

References teardown_class().

Referenced by teardown_class().

◆ test_sink_deployment()

test_regression.TestDynamicCapacitated.test_sink_deployment ( self)

Definition at line 313 of file test_regression.py.

References agent_ids, depl_time, exit_ids, exit_time, and sink_id.

◆ test_source_deployment()

test_regression.TestDynamicCapacitated.test_source_deployment ( self)

Definition at line 306 of file test_regression.py.

References agent_ids, depl_time, and source_id.

◆ test_xaction_general()

test_regression.TestDynamicCapacitated.test_xaction_general ( self)

Definition at line 327 of file test_regression.py.

References receiver_ids, sender_ids, sink_id, source_id, and trans_time.

◆ test_xaction_specific()

test_regression.TestDynamicCapacitated.test_xaction_specific ( self)

Definition at line 342 of file test_regression.py.

References quantities, resource_ids, trans_resource, and trans_time.

Member Data Documentation

◆ agent_ids

int test_regression.TestDynamicCapacitated.agent_ids = cls.to_ary(cls.agent_entry, "AgentId")

Definition at line 284 of file test_regression.py.

Referenced by test_sink_deployment(), and test_source_deployment().

◆ agent_impl

test_regression.TestDynamicCapacitated.agent_impl = cls.to_ary(cls.agent_entry, "Spec")

Definition at line 285 of file test_regression.py.

◆ depl_time

test_regression.TestDynamicCapacitated.depl_time = cls.to_ary(cls.agent_entry, "EnterTime")

Definition at line 286 of file test_regression.py.

Referenced by test_sink_deployment(), and test_source_deployment().

◆ exit_ids

int test_regression.TestDynamicCapacitated.exit_ids = cls.to_ary(cls.agent_exit, "AgentId")

Definition at line 288 of file test_regression.py.

Referenced by test_sink_deployment().

◆ exit_time

test_regression.TestDynamicCapacitated.exit_time = cls.to_ary(cls.agent_exit, "ExitTime")

Definition at line 287 of file test_regression.py.

Referenced by test_sink_deployment().

◆ quantities

test_regression.TestDynamicCapacitated.quantities = cls.to_ary(cls.resources, "Quantity")

Definition at line 300 of file test_regression.py.

Referenced by test_xaction_specific().

◆ receiver_ids

test_regression.TestDynamicCapacitated.receiver_ids = cls.to_ary(cls.transactions, "ReceiverId")

Definition at line 294 of file test_regression.py.

Referenced by test_xaction_general().

◆ resource_ids

test_regression.TestDynamicCapacitated.resource_ids = cls.to_ary(cls.resources, "ResourceId")

Definition at line 299 of file test_regression.py.

Referenced by test_xaction_specific().

◆ sender_ids

test_regression.TestDynamicCapacitated.sender_ids = cls.to_ary(cls.transactions, "SenderId")

Definition at line 293 of file test_regression.py.

Referenced by test_xaction_general().

◆ sink_id

test_regression.TestDynamicCapacitated.sink_id = cls.find_ids(":cycamore:Sink", cls.agent_entry)

Definition at line 290 of file test_regression.py.

Referenced by test_sink_deployment(), and test_xaction_general().

◆ source_id

test_regression.TestDynamicCapacitated.source_id = cls.find_ids(":cycamore:Source", cls.agent_entry)

Definition at line 289 of file test_regression.py.

Referenced by test_source_deployment(), and test_xaction_general().

◆ trans_resource

test_regression.TestDynamicCapacitated.trans_resource = cls.to_ary(cls.transactions, "ResourceId")

Definition at line 296 of file test_regression.py.

Referenced by test_xaction_specific().

◆ trans_time

test_regression.TestDynamicCapacitated.trans_time = cls.to_ary(cls.transactions, "Time")

Definition at line 295 of file test_regression.py.

Referenced by test_xaction_general(), and test_xaction_specific().


The documentation for this class was generated from the following file: