<commit_before>/*
 *  @author <NAME>
 *  
 *  Copyright 2010 University of Zurich
 *      
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  
 *         http://www.apache.org/licenses/LICENSE-2.0
 *  
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  
 */

package signalcollect.implementations.graph

import signalcollect.implementations.messaging.AbstractMessageRecipient
import signalcollect.interfaces.Queue._
import scala.collection.mutable.ListBuffer
import signalcollect.implementations.messaging.MultiQueue
import signalcollect.implementations.messaging.AbstractMessageRecipient
import scala.collection.mutable.Buffer
import scala.collection.mutable.LinkedHashMap
import scala.collection.mutable.ArrayBuffer
import signalcollect.interfaces._
import scala.collection.mutable.HashSet
import scala.collection.mutable.Set
import scala.collection.mutable.HashMap
import scala.collection.mutable.Map

abstract class AbstractVertex[@specialized IdType, @specialized StateType](messageInboxFactory: QueueFactory = Queue.linkedBlockingQueueFactory) extends AbstractMessageRecipient[Any](messageInboxFactory) with Vertex[IdType, StateType] {

  protected def process(message: Any) = {}
	
  /** Setter for {@link #_messageBus} over which this vertex is communicating with its outgoing edges. */
  def setMessageBus(mb: MessageBus[Any, Any]) {
    messageBus = mb
  }

  /** The state of this vertex when it last signaled. */
  protected var lastSignalState: Option[StateType] = None

  /** The message bus over which this vertex is communicating with its outgoing edges. */
  protected var messageBus: MessageBus[Any, Any] = _ // null instead of None (Option) because it simplifies the API. Framework is required to set this before calling {@link #executeSignalOperation}<commit_msg>Added empty initialize function that gets executed after the vertex is fully initialized to AbstractVertex.<commit_after>/*
 *  @author <NAME>
 *  
 *  Copyright 2010 University of Zurich
 *      
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  
 *         http://www.apache.org/licenses/LICENSE-2.0
 *  
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  
 */

package signalcollect.implementations.graph

import signalcollect.implementations.messaging.AbstractMessageRecipient
import signalcollect.interfaces.Queue._
import scala.collection.mutable.ListBuffer
import signalcollect.implementations.messaging.MultiQueue
import signalcollect.implementations.messaging.AbstractMessageRecipient
import scala.collection.mutable.Buffer
import scala.collection.mutable.LinkedHashMap
import scala.collection.mutable.ArrayBuffer
import signalcollect.interfaces._
import scala.collection.mutable.HashSet
import scala.collection.mutable.Set
import scala.collection.mutable.HashMap
import scala.collection.mutable.Map

abstract class AbstractVertex[@specialized IdType, @specialized StateType](messageInboxFactory: QueueFactory = Queue.linkedBlockingQueueFactory) extends AbstractMessageRecipient[Any](messageInboxFactory) with Vertex[IdType, StateType] {

  protected def process(message: Any) = {}
	
  protected def initialize = {}
  
  /** Setter for {@link #_messageBus} over which this vertex is communicating with its outgoing edges. */
  def setMessageBus(mb: MessageBus[Any, Any]) {
    messageBus = mb
    initialize
  }

  /** The state of this vertex when it last signaled. */
  protected var lastSignalState: Option[StateType] = None

  /** The message bus over which this vertex is communicating with its outgoing edges. */
  protected var messageBus: MessageBus[Any, Any] = _ // null instead of None (Option) because it simplifies the API. Framework is required to set this before calling {@link #executeSignalOperation}
{'fraction_non_alphanumeric': 0.07278341420379356, 'fraction_numerical': 0.0035288928098809, 'mean_word_length': 4.7332490518331225, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5045548', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1156, 'n_words': 423}