tinkerpop/furnace — pull request #3 by xhochy (2013-01-15 11:58:52+00:00)
Title: Add functionality to annotate vertices during graph generation.

Currently after Graph generation the information about community membership of vertices is lost. This pull request shall enable the storage about this information. Furthermore I made a more generic interface (influenced by EdgeAnnotator) so that this could be used for other use cases in future.

(It is useful for me as I would like to add various properties afterwards to all vertices depending on their community.)

### Example usage (in scala)

```scala
import com.tinkerpop.blueprints.impls.tg.TinkerGraph
import com.tinkerpop.furnace.generators.{ CommunityGenerator, EdgeAnnotator, NormalDistribution, PowerLawDistribution, VertexAnnotator }

object Generator {
def main(args: Array[String]) = {
val graph = new TinkerGraph
Range(0, 100).foreach(graph.addVertex(_))
val generator = new CommunityGenerator("edge", EdgeAnnotator.NONE, VertexAnnotator.COPY_CONTEXT)
generator.setCommunityDistribution(new NormalDistribution(3));
generator.setDegreeDistribution(new PowerLawDistribution(2.3));
generator.setCrossCommunityPercentage(0.1);
val numEdges = generator.generate(graph, 10, 1000);
}
}
```