bin_packing 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54d605afad8bf79dcfb7abb3cc589b54e2ea9ab298cb75d32570c13ecbbec7d6
4
- data.tar.gz: d9262871c5bc9c33bf68d5c2caebc647c42fa99ea8c364b3f35bd8f6296fa636
3
+ metadata.gz: 5ef470e8441cd54ea57580c007c72a5d4df20bdbc5758588493ee6b0e0ae2ee1
4
+ data.tar.gz: 8a5d22af4f91506e1e4f5cd4736aa53109e1434dccbe03bfee5d687ccd2715fa
5
5
  SHA512:
6
- metadata.gz: b5f860651a0707f34f385235d899dfe2b1ff2132b0f69e7e81782257d4110ad95ad1b8df90ed81c741c4a80d4cf03173149205bbdadea1f124323b1c5fe7063f
7
- data.tar.gz: cb3ad7491d7ca39d4f90060c28d747cf0ae0156e8a342b34e7f8bc1806a858f22282fecc0cce91bb6e452ea114897ca4da1eaac1e0b8681cfe4d8f9cfcaa7143
6
+ metadata.gz: d8a49b93d728bf9ea24071c56bfdd383b2ff7e2a2851615df407a6aee406f64c4d895c99f907d7feee3a8521185edc4a04a8d7054acd7dbbcbe8e85f50b4d1b3
7
+ data.tar.gz: 3b9ae8c3854a945120de8cee9ba86d728576fd095a93960dffa6e5629577afb1cea77fe63542cf0f7ff9b548fc19599042cd4492dddb29bf042f6f7576de0ad4
@@ -25,6 +25,18 @@ module BinPacking
25
25
  @heuristic.find_position_for_new_node!(box, @free_rectangles)
26
26
  return false unless box.packed?
27
27
 
28
+ insert_in_known_position(box)
29
+ end
30
+
31
+ def insert!(box)
32
+ unless insert(box)
33
+ raise ArgumentError, "Could not insert box #{box.inspect} "\
34
+ "into bin #{inspect}."
35
+ end
36
+ self
37
+ end
38
+
39
+ def insert_in_known_position(box)
28
40
  num_rectangles_to_process = @free_rectangles.size
29
41
  i = 0
30
42
  while i < num_rectangles_to_process
@@ -42,14 +54,6 @@ module BinPacking
42
54
  true
43
55
  end
44
56
 
45
- def insert!(box)
46
- unless insert(box)
47
- raise ArgumentError, "Could not insert box #{box.inspect} "\
48
- "into bin #{inspect}."
49
- end
50
- self
51
- end
52
-
53
57
  def score_for(box)
54
58
  @heuristic.find_position_for_new_node!(box.clone, @free_rectangles)
55
59
  end
@@ -1,3 +1,3 @@
1
1
  module BinPacking
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bin_packing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MAK IT
@@ -14,26 +14,26 @@ dependencies:
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '3.0'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 3.0.0
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '3.0'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 3.0.0
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
33
33
  description: 'Provides algorithm for placing rectangles (box-es) in one or multiple
34
34
  rectangular areas (bins) with reasonable allocation efficiency.
35
35
 
36
- '
36
+ '
37
37
  email: info@makit.lv
38
38
  executables: []
39
39
  extensions: []
@@ -76,8 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubyforge_project:
80
- rubygems_version: 2.7.6
79
+ rubygems_version: 3.0.6
81
80
  signing_key:
82
81
  specification_version: 4
83
82
  summary: 2D bin packing algorithm